.NET프로그래밍/SQL Server 2008
4. OLE DB 설정 : 원격 접속 테스트
holland14
2009. 9. 9. 19:35
OLE DB 설정 : 원격 접속 테스트
- DB접속을 위한 4가지 필수 조건(항목) : 커넥션 스트링(Connection String)
- Server / Data Source
- Database / Initial Catalog
- User ID / Uid
- Password / Pwd
- 데이터베이스 연결문자열 : 닷넷 프로그래밍에서 필요
- ConnectionString = "Server=(local)\SQLExpress;Database=MyDatabase;User ID=My;Password=Pa$$w0rd;";
- ConnectionString="Data Source=(local)\SQLExpress;Initial Catalog=MyDatabase;uid=My;pwd=Pa$$w0rd;";
- UDL 파일을 만들어서 데이터베이스 연결문자열을 생성
- *.txt -> 확장자를 *.udl로 변경 -> 속성 -> 4가지 정보 기록 후 저장 -> udl 파일을 노트패드로 열면 데이터베이스 연결문자열을 얻을 수 있다.
- ASP3.0까지는(.NET 이전버전) Provider절 사용
- ASP.NET 이후로(.NET 이후버전) Provider절 제외해서 사용
** 추가 참고자료
"MyDatabase"라는 DB에 접근하려면 아래에서 4가지 정보가 필요하다.
[oledb]
; Everything after this line is an OLE DB initstring
Provider=SQLOLEDB.1;Password=rkfcl;Persist Security Info=True;User ID=My;Initial Catalog=MyDatabase;Data Source=(local)\SQLExpress