Runtime error

Rafaiya Rushdha Oishi 21 Reputation points
2021-02-03T14:22:59.45+00:00

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

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,246 questions
C#
C#
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,204 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yihui Sun-MSFT 801 Reputation points
    2021-02-05T07:15:12.743+00:00

    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,
    YihuiSun


3 additional answers

Sort by: Most helpful
  1. Duane Arnold 3,211 Reputation points
    2021-02-03T18:12:37.743+00:00

    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
    2021-02-04T06:21:12.193+00:00

    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,211 Reputation points
    2021-02-06T15:48:01.667+00:00

    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.