.MDF Deployment but no connection on target machine

  • Thread starter Thread starter Scott77_77
  • Start date Start date
S

Scott77_77

Guest
Hi All,

I've spent near 3 full days going round in circles searching and try things so if someone could advise I would really appreciate it!

I'm Developing on Windows 10, in VS 2017. I have SSMS installed and Office 365

Target device Runs windows 10 and that is about it so it quite empty so I thought a good test bed to try a load on.


The issue I have is I have created a windows forms App that connects to a local .MDF file that works fine on mine during dev (usual start to these posts) and installs fine after publish, but on the target machine it error on connection to the .mdf file.

Things I have done:

  • Made sure the .MDF file is on the target machine
  • Ticked the SQL Server 2012 Express LocalDB in Prerequisites
  • Set the file to 'DATA FILE (AUTO) , Required, Included
  • Connection sting is:"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\C_control.mdf;Integrated Security=True"
  • I have played with the Conn string to add 11.0 and 12.0 instead of the MSSQLLocal DB and put the Application path in place of data directory
  • Deployed via Oneclick and also created my own Setup solution to deliver

The error I get is (shortened)

' A networlk related or instance specific error occurred while establishing a connection to SQL Server. The Server was not found or was not accessible, Verify the instance name is correct and that SQl server is configured to allow remote connections. Error 56 Unble to load the SQL userinstance.dll from the location specified on the registry Verify that the local database runtime feature of SQL server Express is property installed.


So SQL Server would not be on this machine as it's just pretty bland at the moment. I added the '2012 Express LocalDB' as understood that this would install the basics to run queries against the .mdf file.

The way it was told to me before development is that this method is much like adding an access file and using that as a database but you can use a SQL lite version which doesn't need the end user to install SQL server on their machine.

Could someone advise please as t's taking days out of my life :(


Regards

Scott

Continue reading...
 

Similar threads

D
Replies
0
Views
769
DexterCamarillo
D
D
Replies
0
Views
714
DexterCamarillo
D
D
Replies
0
Views
306
DexterCamarillo
D
Back
Top