visual studio - Database Connection .NET MVC -
i learning basics of .net, using mvc model. seems simple enough, except connecting models local database, have been having nothing trouble.
whatever screwed up, don't seem able connect project (or other projects) database using connection strings, , when try add>new item> sql server database error:
a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: sql network interfaces, error: 50 - local database runtime error occurred. specified localdb instance not exist.) unfortunately, problem has been hard diagnose, unfamiliar windows server.
right now, have 1 model in application "getquestions"
here connection strings:
<connectionstrings> <add name="defaultconnection" connectionstring="data source=(localdb)\v11.0;attachdbfilename=c:\users\{{myusername}}\appdata\local\microsoft\microsoft sql server local db\instances\v11.0\master.mdf;initial catalog=getquestions;integrated security=true" providername="system.data.sqlclient" /> <add name="questionsdbcontext" connectionstring="data source=(localdb)\v11.0;;attachdbfilename=c:\users\{{myusername}}\appdata\local\microsoft\microsoft sql server local db\instances\v11.0\master.mdf;integrated security=true" providername="system.data.sqlclient" /> </connectionstrings> i'm hoping noob mistake can fix. have looked @ several general walkthroughs nothing seems work.
i have screenshots of server explorer , server object explorer can diagnose problem, stackoverflow not allow me post them.
try one. replace 2 connection string have. moreover, change database path located.
<add name="questionsdbconntext" connectionstring="data source=.\sqlexpress;attachdbfilename=c:\users\master.mdf;initial catalog=getquestions;integrated security=true" providername="system.data.sqlclient" />
Comments
Post a Comment