2010-01-25 6 views
0

연결 문자열에 드라이버가있는 코드가 있습니다. 난 그냥 텍스트를 변경하면연결 문자열의 드라이버를 VB.Net의 데이터 소스로 변경하십시오.

, 그것은이 오류를 제공합니다

dim s as string = "Driver={SQL Server}; 
Server=xxx\SQLEXPRESS; 
Database=dbRegister; 

Trusted_Connection = 예 "

data source=1.2.3.4; 
user id=xx; 
password=xxxxx; 
initial catalog=xxxxx; 

연결 시간 초과 = 30

난 그 변경해야"

[Microsoft][ODBC Driver Manager] Data source name not found and 
            no default driver specified 

데이터 소스를 어떻게 선언합니까?

+0

호기심, 이것을 바꾸려는 동기는 무엇입니까? – JonathanK

답변

0

Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

특정 SQL Server 인스턴스에 연결하기 위해 데이터 원본으로 serverName \ instanceName을 사용하십시오.

SQL Server 2005 Express를 사용하고 있습니까? Servername \ SQLEXPRESS 서버 이름 구문을 놓치지 마십시오. 여기서 Servername은 SQL Server 2005 Express 설치가있는 컴퓨터의 이름으로 대체하십시오.

연결 문자열의 모든 종류의

http://www.connectionstrings.com/

방문.

0

인스턴스 이름 (예 : Data Source=1.2.3.4\SQLEXPRESS)을 잊지 마세요.

관련 문제