On my small development computer I've MS SQL Server/Visual Studio 2005. My program can properly connect with my local DB and employ it. However my other computer (non-dev) doesn't have MS SQL Server/Visual Studio 2005 and doesn't connect with the DB. It spits the following:

"A mistake has occurrred while creating an association towards the server. When hooking up to SQL Server 2005, this failure might be triggered because underneath the default configurations SQL Server doesn't allow remote connections. ..." (Error: 26).

Performs this mean I must install SQL Server 2005 on my small non-dev computer systems? Can there be every other way?

My connection string is:

"DatabasesEquals.SQLEXPRESSAttachDbFilename="" + Directory.GetCurrentDirectory() + "DB.mdf"Integrated Security=TrueUser Instance=True"

If you wish to run it on that other pc/server you should also have SQL Server (have to attach your .mdf into it) or SQL Server Express installed.

As is always to improve your connection string to ensure that it highlights to a different pc/server where your database operates on.

Your connection string is telling the Sql Server Native Client ADO.Internet Provider to try to connect with a Sql Server instance named SQLEXPRESS which will manage the database saved inside a file DB.mdf. As your client computer doesn't have Sql Server Express installed, it will not look for a database for connecting to.

You will have to:

  • Install Sql Server around the client computer and deploy your database there.
  • Change to Sql Server Compact Edition (SqlCE - embedded database) and re-architect the application to make use of the portable database file (with SqlCE) rather.
  • Ditch utilizing a robust database engine and switch entirely to ADO.Internet DataSets, saving/loading the items in the DataSet for an Xml file (via WriteXml() and ReadXml()). If the quantity of data you're processing is rather limited in dimensions, DataSets make the perfect method of maintaining integrity (using a strongly typed and well-defined schema) and portability.