none
Local DB and SQL Server in Win10 - program created by VS2015

    Question

  • Using VS2015 I created an application which is using local database. The app is failing with the exception:
    "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."
     
    Do I need to install any SQL Server in order to run my application?
    Is VS2015 installing any servers by default?

    Thanks,

    zb
    Wednesday, April 6, 2016 4:08 PM

Answers

  • Hi,

    I understood that your application fails when copied / installed on another system. I hope that is correct.

    Local Database is part of the MS SQL Server Express and can be installed on the target system using the SqlLocalDB.msi from MS SQL Server Express.
    For SQL Server Express 2014 the downloads can be found at https://www.microsoft.com/en-us/download/details.aspx?id=42299

    (Be aware that there is a 32bit and a 64bit version of that file!)

    I hope this reply helped.

    With kind regards,

    Konrad

    Wednesday, April 6, 2016 4:46 PM
    Moderator
  • I just figured what happened: there are 2 kinds of databases: service-based database and local database.

     

    service-based database is when the database is stored on a server. To access the database, you need to have the SQL Server service running. The extension of the file is .mdf

     

    "local database" is a database that is stored on the local PC where an application resides. There is no need to install a server to access an SDF database

    The extension of the file is .sdf

     

    In my application the database file has extension .mdf, it means it requires service-base database, like SQL Server Express. After installing SQL Server Express my program is working.

     

     

    Thursday, April 7, 2016 4:30 PM

All replies

  • Hi,

    I understood that your application fails when copied / installed on another system. I hope that is correct.

    Local Database is part of the MS SQL Server Express and can be installed on the target system using the SqlLocalDB.msi from MS SQL Server Express.
    For SQL Server Express 2014 the downloads can be found at https://www.microsoft.com/en-us/download/details.aspx?id=42299

    (Be aware that there is a 32bit and a 64bit version of that file!)

    I hope this reply helped.

    With kind regards,

    Konrad

    Wednesday, April 6, 2016 4:46 PM
    Moderator
  • I just figured what happened: there are 2 kinds of databases: service-based database and local database.

     

    service-based database is when the database is stored on a server. To access the database, you need to have the SQL Server service running. The extension of the file is .mdf

     

    "local database" is a database that is stored on the local PC where an application resides. There is no need to install a server to access an SDF database

    The extension of the file is .sdf

     

    In my application the database file has extension .mdf, it means it requires service-base database, like SQL Server Express. After installing SQL Server Express my program is working.

     

     

    Thursday, April 7, 2016 4:30 PM
  • Hi Zalek Bloom,

    I'm glad that you have figured out your problem and thanks for sharing your solution here. Please mark your solution and the helpful replay as answer, which is benefit to other communities who has the same problem.

    If any problem in future, please feel free to come back to our forum.

    Best Regards,
    Weiwei

    Friday, April 8, 2016 2:35 AM
    Moderator