下面连接数据库的代码,你能告诉我哪里弄错了吗?
SqlConnectionStringBuilder setting = new SqlConnectionStringBuilder();
setting.DataSource = ".\\SQLExpress";
setting.InitialCatalog = "PCM_NEW";
// setting.UserInstance = true;
setting.IntegratedSecurity = true;
setting.AttachDBFilename = @"C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\PCM_NEW.mdf";
//setting.UserID = "LKALAY\\SQLEXPRESS";
SqlConnection baglanti = new SqlConnection(setting.ConnectionString);
return baglanti;
我收到错误:
错误:提供者:SQL网络接口,错误:26