SqlCeEngine.Upgrade 메서드 (String)
SQL Server Compact 데이터베이스 3.5를 4.0으로 업그레이드합니다. 암호화 모드가 대상 연결 문자열에 지정되어 있으면 대상 데이터베이스가 암호화됩니다. 연결 문자열에서 대/소문자 구분 속성이 true로 설정되어 있으면 데이터베이스의 데이터 정렬이 대/소문자를 구분합니다.
네임스페이스: System.Data.SqlServerCe
어셈블리: System.Data.SqlServerCe(System.Data.SqlServerCe.dll)
구문
‘선언
Public Sub Upgrade ( _
destConnectionString As String _
)
‘사용 방법
Dim instance As SqlCeEngine
Dim destConnectionString As String
instance.Upgrade(destConnectionString)
public void Upgrade(
string destConnectionString
)
public:
void Upgrade(
String^ destConnectionString
)
member Upgrade :
destConnectionString:string -> unit
public function Upgrade(
destConnectionString : String
)
매개 변수
- destConnectionString
유형: System.String
대상 데이터베이스에 대한 연결 문자열입니다.
예
다음 예제에서는 이전에 만든 SQL Server Compact 데이터베이스를 대/소문자가 구분되는 SQL Server Compact 데이터베이스로 업그레이드하는 방법을 보여 줍니다.
/// <summary>
/// Demonstrates how to upgrade a database with case sensitivity.
/// </summary>
public static void UpgradeDatabasewithCaseSensitive()
{
// <Snippet2>
// Default case-insentive connection string.
// Note that Northwind.sdf is an old 3.1 version database.
string connStringCI = "Data Source= Northwind.sdf; LCID= 1033";
// Set "Case Sensitive" to true to change the collation from CI to CS.
string connStringCS = "Data Source= Northwind.sdf; LCID= 1033; Case Sensitive=true";
SqlCeEngine engine = new SqlCeEngine(connStringCI);
// The collation of the database will be case sensitive because of
// the new connection string used by the Upgrade method.
engine.Upgrade(connStringCS);
SqlCeConnection conn = null;
conn = new SqlCeConnection(connStringCI);
conn.Open();
//Retrieve the connection string information - notice the 'Case Sensitive' value.
List<KeyValuePair<string, string>> dbinfo = conn.GetDatabaseInfo();
Console.WriteLine("\nGetDatabaseInfo() results:");
foreach (KeyValuePair<string, string> kvp in dbinfo)
{
Console.WriteLine(kvp);
}
// </Snippet2>
}