-3

I'm running asp.net mvc5 project in visual 2013,and I got error in my startup.cs.

This is for visual stuio 2013 and sql server 2012 project.

The project was working before ,but I formatted my computer and set up again.

    <connectionStrings>
    <add name="DefaultConnection"
         connectionString="Data Source=(LocalDB)\;
         AttachDbFilename=&quot;|DataDirectory|\BARDB.mdf&quot;;
         Initial Catalog=&quot;BARDB&quot;;
         Integrated Security=True"
      providerName="System.Data.SqlClient" />
  </connectionStrings> 


[Look at this picture for the place of the error.][1]


  [1]: https://i.stack.imgur.com/GvyLp.png
Addow
  • 104
  • 1
  • 2
  • 7
  • 1
    Possible duplicate of [Why did a network-related or instance-specific error occur while establishing a connection to SQL Server?](https://stackoverflow.com/questions/1391503/why-did-a-network-related-or-instance-specific-error-occur-while-establishing-a) and https://stackoverflow.com/questions/18060667/why-am-i-getting-cannot-connect-to-server-a-network-related-or-instance-speci and probably more. – David Aug 12 '19 at 15:54
  • I tried all of these solutions, none of them worked for me. – Addow Aug 12 '19 at 16:24
  • Any new idea that can help me ? – Addow Aug 12 '19 at 16:25
  • Perhaps you could elaborate on how your question is in any way different from those? Or from anything else found by Googling the text of the error message. (Which you never included in the question, just a screen shot of it. Text is much easier to search.) What is your connection string? How have you confirmed that the database is currently running and should be reachable from this application? – David Aug 12 '19 at 16:30
  • That is my connection string: – Addow Aug 12 '19 at 16:35

1 Answers1

0

The solution was to use:

connectionString="Data Source=(LocalDb)\v11.0

instead of :

connectionString="Data Source=(LocalDb)\mssqlexpress

Thank you all.

Addow
  • 104
  • 1
  • 2
  • 7