Results 1 to 10 of 10

Thread: sqllocal not working on client machine

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2019
    Posts
    30

    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

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2019
    Posts
    30

    Re: sqllocal not working on client machine

    Quote Originally Posted by techgnome View Post
    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

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    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'.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jul 2019
    Posts
    30

    Re: sqllocal not working on client machine

    Quote Originally Posted by jmcilhinney View Post
    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>

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: sqllocal not working on client machine

    Quote Originally Posted by Saint Neaj View Post
    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.

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Jul 2019
    Posts
    30

    Re: sqllocal not working on client machine

    Quote Originally Posted by jmcilhinney View Post
    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
    Name:  IMG-20201110-WA0080.jpg
Views: 221
Size:  44.4 KB

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    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.

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Jul 2019
    Posts
    30

    Re: sqllocal not working on client machine

    Quote Originally Posted by jmcilhinney View Post
    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

  10. #10
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: sqllocal not working on client machine

    Quote Originally Posted by Saint Neaj View Post
    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
  •  



Click Here to Expand Forum to Full Width