0

I'm working on one Windows forms application using one .mdf file. And I have Sql Server 2008 installed in my machine , it is working fine in my machine. Now I need to install this application in Client's machine, Client's machine don't have Sql Server if they try to access this getting Network related exception, ie,

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

and this is my connection string in app.config file,

  <add name="CustomConnection" connectionString="Integrated Security=True;MultipleActiveResultSets=True;Connect Timeout=120;User Instance=True;AttachDbFilename=C:\Users\[username]\AppData\Roaming\Smart\App_Data\SampleDB.mdf" providerName="System.Data.SqlClient" />

Can we access the .mdf file without Sql Server instance? If yes how can we set the ConnectionString value.

Thanks, Abhishek

  • No. You need to install SQL-Server or provide access to your server. – Igor Borisenko Nov 25 '15 at 06:17
  • It is working fine in machine, and if I install this application on another machine which don't have Sql Server then it is throwing an Exception 'network-related or instance-specific error occurred while establishing a connection to SQL Server', Is it required to change the connection string? – Abhishek Hotte Nov 25 '15 at 06:23
  • So, you need to install SQL-Server on that machine or provide access to your server. – Igor Borisenko Nov 25 '15 at 06:27
  • Without Sql Server we can't access the mdf file? – Abhishek Hotte Nov 25 '15 at 06:29
  • I already said "No" in my first comment. Actually, you can import it to some another server, for example MS Access. But it will lead to even more problems. – Igor Borisenko Nov 25 '15 at 06:43
  • Thanks for your help. Is there any way to access other databases, which don't need installation? – Abhishek Hotte Nov 25 '15 at 06:46
  • You can use localDB, which is sql server without installing sql server. If you google it you will find lots of references. – GuidoG Nov 25 '15 at 15:00
  • What are the minimum required files(SQL setup files) to install in the Client machine to access .mdf file ? ie, Prerequisites for a setup project. – Abhishek Hotte Nov 26 '15 at 12:01

0 Answers0