I have done a project in VB.Net and sqllocaldb.
I tried to install it on different machine but it always generate an error. I have tried install sqllocaldb.msi but still not avail.
Please how do I go by it
Printable View
I have done a project in VB.Net and sqllocaldb.
I tried to install it on different machine but it always generate an error. I have tried install sqllocaldb.msi but still not avail.
Please how do I go by it
Did you attach the database files after installing sqllocaldb? SqlLocalDB is something to use to set up an instance of SQL Server Express... but once it's up and running, you'll need to attach the db files (mdf & ldf) in order for the database to actually be there.
-tg
Show us your connection string.
LocalDB is supposed to be for developers. It is not really intended to be used in the wild. Your users should be installing SQL Server Express. If you deploy the MDF file with your application then you can use AttachDbFilename in your connection string to attach the file to the instance on demand, just as you do with LocalDB. You would just need to change the instance name appropriate, i.e. the Data Source in the connection string would be set to '.\SQLEXPRESS'.
My connection string
<connectionStrings>
<add name="Stock.My.MySettings.StockConnectionString" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\stockdb.mdf;Integrated Security=True;Connect Timeout=30" providerName="System.Data.SqlClient"/>
</connectionStrings>
Have you actually installed LocalDB on the client machine? Is the MDF file deployed along with your EXE? What actually happens when you run your app? If an exception is thrown, you're supposed to actually look at it to find out what information it provides to diagnose the issue.
a attached is the image of the error message
Attachment 179209
Thank you for providing that text as an image and thereby making it harder to read. Regardless, the error message is telling you that the SQL Server instance you're trying to connect to either doesn't exist or is inaccessible. As LocalDB is local, accessibility is not the issue.
You'll either install the instance you're trying to connect to or connect to the instance you've installed. I already gave you advice in previous posts and they seem to have been ignored, so I'm not sure how ready you really are. It seems like you're ready for a copy-and-paste solution, which isn't really learning.