Runtime error

Rafaiya Rushdha Oishi 21 Reputation points

error: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. I am getting this type of eror.Can you suggest any solution?

A set of technologies in the .NET Framework for building web applications and XML web services.
3,307 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,370 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yihui Sun-MSFT 801 Reputation points

    Hi @Rafaiya Rushdha Oishi ,
    You can try to use (localdb)\mssqllocaldb as server name to connect to the LocalDB automatic instance.

    <add name="xxxx" connectionString="Data Source=(localdb)\mssqllocaldb;   

    You can check this link to learn more.

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Best Regards,

3 additional answers

Sort by: Most helpful
  1. Duane Arnold 3,216 Reputation points

    What does the connectionstring look like? Post it.

    What is the program ASP.NET? What is hosting/running the program, Windows desktop, IIS and ASP.NET or what? A Web hosting provider or what?

    0 comments No comments

  2. Rafaiya Rushdha Oishi 21 Reputation points

    Hi i am using ASP.NET and running the program on IIS and this is the connectionstring63819-error.jpg

    0 comments No comments

  3. Duane Arnold 3,216 Reputation points

    Hi i am using ASP.NET and running the program on IIS and this is the connectionstring

    If you are using IIS on a server or Local IIS on your development machine, then using localDB is not going to work. The MDF file will need to moved to the MS SQL Server directory and the MDF file 'Attached' to the database engine.

    LocalDB will not work for a multi-user environment platform like IIS.