Windows 7 64 비트 PC에 SQL Server 2005, 2008 및 2012가 설치되어 있습니다. 이 필요한 경우 ... 확실하지 SQL 데이터베이스에 연결할 수 없습니다. - C#, VS2012, SQL Server 2012
여기 내 구성 관리자이고, 나는 에이전트가 중지 된 것을 볼 수 없습니다. 크기가 나타 그래서 나는 두 개의 이미지로 그것을 밖으로 분할 한 큰
여기에 VS2012의 데이터베이스 탐색기 창에 표시되는 것입니다. 이
다음내 코드 언급 한 바와 같이
string selectSql = "select * from Tasks";
string connectionString = "Data Source=adamssqlserver;Database=master;Integrated Security=True;";
using (var cn = new SqlConnection(connectionString))
using (var cmd = new SqlCommand(selectSql, cn))
{
cn.Open(); // this is the line that throws the error message.
using (var reader = cmd.ExecuteReader())
{
//do something
}
}
의 cn.Open() 인 SQL 서버 2012 데이터베이스입니다; 라인이
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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
string connectionString = "데이터 원본 = lpc192 \ adamssqlserver, 데이터베이스 = 마스터, 통합 보안 = True; "; – bummi