How to make a dB connection on another PC?

connect local database on my PC everything works, the other does not work although the file path is automatically set
swears it is on the dB connection.

"************ Exception Text **************
System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.) ---> System.ComponentModel.Win32Exception (0x80004005): the system cannot find the file specified"

string file = @"\Database1.mdf";
 string path = Path.Combine(Environment.CurrentDirectory);
 full_fille string = path + file;
 connect = @"Data Source = (LocalDB)\MSSQLLocalDB; AttachDbFilename="+full_fille+";Integrated Security = True";

the project ""

April 18th 20 at 12:54
1 answer
April 18th 20 at 12:56
You clearly said that
52 - Unable to locate a Local Database Runtime installation.

Put sqlexpress. And everything will start.
Additionally, configure the connection using the database. Option file it is more for development.
the server can be such as to deliver? or will have to rewrite everything? - marlin.MacGyv commented on April 18th 20 at 12:59
@Nikko, In General, see the General method is this:

On your SQL server, attach the file that you already have.
If necessary, change the name of the database.

Then in the program change the connection string to the following

Actually, it all. Or put sqlexpress and use the old method.

59c3d882da.jpg - devan87 commented on April 18th 20 at 13:02
Actually, it all
not a fact. we still have ports open in the firewall. as for the adult server (if not configured yet) and the Express edition. in addition, for servers, it is sufficient to open a single port, and with Express may have to Tinker
(I never had the patience to get to the bottom that would light up the Express server browse )) - Magdalen.Walker commented on April 18th 20 at 13:05
@rogers_Hin, I have not delved. If Express, then add in the installer and let him put, of course, the choice of a sequel is present. And so the corporate are almost always uzhev the organization and configured.
The maximum that request that DBA gave rights and unrolled backup or defy. - devan87 commented on April 18th 20 at 13:08
@Tate5, about and understood. by kament to a greater extent, even for TC. since he obviously is able to resolve )) - Magdalen.Walker commented on April 18th 20 at 13:11
@Nikko, on the topic of firewall, if you have any difficulty, you'll appreciate these links - Magdalen.Walker commented on April 18th 20 at 13:14

Find more questions by tags SQLC#