|
-
Nov 9th, 2020, 01:32 PM
#1
Thread Starter
Junior Member
sqllocal not working on client machine
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
-
Nov 9th, 2020, 02:51 PM
#2
Re: sqllocal not working on client machine
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
-
Nov 9th, 2020, 04:34 PM
#3
Thread Starter
Junior Member
Re: sqllocal not working on client machine
 Originally Posted by techgnome
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
Yes please, all in the exe file. It does work my PC
-
Nov 9th, 2020, 07:51 PM
#4
Re: sqllocal not working on client machine
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'.
-
Nov 10th, 2020, 04:09 AM
#5
Thread Starter
Junior Member
Re: sqllocal not working on client machine
 Originally Posted by jmcilhinney
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>
-
Nov 10th, 2020, 04:17 AM
#6
Re: sqllocal not working on client machine
 Originally Posted by Saint Neaj
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.
-
Nov 10th, 2020, 01:38 PM
#7
Thread Starter
Junior Member
Re: sqllocal not working on client machine
 Originally Posted by jmcilhinney
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
-
Nov 10th, 2020, 07:06 PM
#8
Re: sqllocal not working on client machine
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.
-
Nov 11th, 2020, 02:23 AM
#9
Thread Starter
Junior Member
Re: sqllocal not working on client machine
 Originally Posted by jmcilhinney
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.
Hmmmm, so please in case how will I resolve it. Ready learn please
-
Nov 11th, 2020, 02:27 AM
#10
Re: sqllocal not working on client machine
 Originally Posted by Saint Neaj
Hmmmm, so please in case how will I resolve it. Ready learn please
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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|