c# - Database connectivity error in Visual Studio? -


i have lost connectivity using visual studio 2012 database... when try reconnect , run application here exception enter image description here

note: previous file deleted mistakenly, , trying attach new 1 says exist? solution?

what kind of database running? specify:

if have sqlexpress database: first need change data source name this.

"data source=(localdb)\v11.0" "data source=.\sqlexpress" 

to connect local sql server instance, issue following string:

server=.\sqlexpress;attachdbfilename=c:\myfolder\mydatafile.mdf;database=dbname trusted_connection=yes; 

to connect local sql server instance database file located in data directory, issue following string:

server=.\sqlexpress;attachdbfilename=|datadirectory|mydbfile.mdf;database=dbname trusted_connection=yes; 

to connect localdb automatic instance, issue following string:

server=(localdb)\v11.0;integrated security=true; 

to connect localdb automatic instance specific data, issue following string:

server=(localdb)\v11.0;integrated security=true; attachdbfilename=c:\myfolder\mydata.mdf; 

to connect localdb named instance, issue following string:

server=(localdb)\myinstance;integrated security=true; 

you need string matches specific db exactly, connect.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -