SqlCeConnection 생성자
SqlCeConnection 클래스의 새 인스턴스를 초기화합니다.
네임스페이스: System.Data.SqlServerCe
어셈블리: System.Data.SqlServerCe(System.Data.SqlServerCe.dll)
구문
‘선언
<SecurityTreatAsSafeAttribute> _
<SecurityCriticalAttribute> _
Public Sub New
‘사용 방법
Dim instance As New SqlCeConnection()
[SecurityTreatAsSafeAttribute]
[SecurityCriticalAttribute]
public SqlCeConnection()
[SecurityTreatAsSafeAttribute]
[SecurityCriticalAttribute]
public:
SqlCeConnection()
[<SecurityTreatAsSafeAttribute>]
[<SecurityCriticalAttribute>]
new : unit -> SqlCeConnection
public function SqlCeConnection()
주의
SqlCeConnection의 새 인스턴스를 만들 때, ConnectionString 속성의 관련 키워드를 사용하여 명확하게 설정하지 않는 한, 읽기/쓰기 속성은 다음 초기 값으로 설정됩니다.
속성 |
초기 값 |
---|---|
빈 문자열("") |
|
빈 문자열("") |
ConnectionString 속성만 사용하여 이 속성의 값을 변경할 수 있습니다.
예
다음 예제에서는 SqlCeConnection을 만들고 엽니다.
Dim conn As New SqlCeConnection()
' Set some connection string properties e.g.:
'
conn.ConnectionString = _
"Persist Security Info = False; Data Source = 'SalesData.sdf';" & _
"Password = '<password>'; File Mode = 'shared read'; " & _
"Max Database Size = 256; Max Buffer Size = 1024"
conn.Open()
' You can change the database while preserving
' the orignal connection options
'
conn.ChangeDatabase("SupportData.sdf")
SqlCeConnection conn = new SqlCeConnection();
// Set some connection string properties e.g.:
//
conn.ConnectionString =
"Persist Security Info = False; Data Source = 'SalesData.sdf';" +
"Password = '<password>'; File Mode = 'shared read'; " +
"Max Database Size = 256; Max Buffer Size = 1024";
conn.Open();
// You can change the database while preserving
// the orignal connection options
//
conn.ChangeDatabase("SupportData.sdf");