I have a c# program that connect with a connection string to a db
. I want to copy the program in another pc and copy .mdf file
in debug folder. When I use
Data Source=.\\SQLEXPRESS;initial catalog=test;Integrated Security=true;
I have error like
SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified
in other pc.
in the other hand when I change the cstring
like this
Data Source=.\\SQLEXPRESS;AttachDbFileName=|DataDirectory|test.mdf;Integrated Security=true;
I have this error in my visual studio
Database '{0}' already exists. Choose a different database name. Cannot attach the file '{0}' as database '{1}'.
Really I dont know how fix this error help !
Is it necessary to have a server name SQLEXPRESS
and a db name test
in other pc ??