Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Am using Connection string as this but it raise an error like

"Cannot open database "Test" requested by the login. The login failed.
Login failed for user 'sa'."

string connectionString = @"Data Source=192.168.123.123,1433;Initial Catalog=Test;Network Library=DBMSSOCN; User ID=sa;Password=Test@2014";

after restoring my bakup file, i detatched that Database then i want to access that database.

That .mdf and .ldf files are in Domain. i want to acces from my client PC.
Posted

Here is a good site for connection strings http://www.connectionstrings.com/[^]
 
Share this answer
 
Specify Master as the initial catalog and attach the database via CREATE DATABASE

FOR ATTACH [ WITH < attach_database_option > ]
Specifies that the database is created by attaching an existing set of operating system files. There must be a <filespec> entry that specifies the primary file. The only other <filespec> entries required are those for any files that have a different path from when the database was first created or last attached. A <filespec> entry must be specified for these files.
FOR ATTACH requires the following:

All data files (MDF and NDF) must be available.

If multiple log files exist, they must all be available.



http://msdn.microsoft.com/en-us/library/ms176061.aspx[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900