SqlCeLockTimeoutException 클래스

이 예외는 잠금 제한 시간에 도달하면 throw됩니다.

네임스페이스: System.Data.SqlServerCe
어셈블리: System.Data.SqlServerCe(system.data.sqlserverce.dll)

구문

‘선언
Public Class SqlCeLockTimeoutException
    Inherits SqlCeException
‘사용 방법
Dim instance As SqlCeLockTimeoutException
public class SqlCeLockTimeoutException : SqlCeException
public ref class SqlCeLockTimeoutException : public SqlCeException
public class SqlCeLockTimeoutException extends SqlCeException
public class SqlCeLockTimeoutException extends SqlCeException

설명

자세한 내용은 SQL Server Mobile Books Online의 "Locking (SQL Server Mobile)" 항목을 참조하십시오.

예제

Dim timeout As New TimeSpan(0, 0, 15) 'hours, minutes, seconds
Dim startTime As DateTime = DateTime.Now

While DateTime.Now - startTime < timeout
    Try
        Dim repl As New SqlCeReplication()

        repl.InternetUrl = "https://www.adventure-works.com/sqlmobile/sqlcesa30.dll"
        repl.Publisher = "myPublisher"
        repl.PublisherDatabase = "AdventureWorks"
        repl.PublisherSecurityMode = SecurityType.NTAuthentication
        repl.Publication = "AdventureWorks"
        repl.Subscriber = "Test"
        repl.SubscriberConnectionString = "Data Source='MyDatabase.sdf';Password='';"
        repl.Synchronize()
    Catch exInProgress As SqlCeTransactionInProgressException
        Thread.Sleep(3000)
        GoTo ContinueWhile1
    Catch exTimeout As SqlCeLockTimeoutException
        ' Add your own error-handling logic here
         GoTo ContinueWhile1
    Catch e As SqlCeException
        MessageBox.Show(e.Message)
    End Try
ContinueWhile1:
End While
TimeSpan timeout = new TimeSpan(0 /*hours*/, 0 /* minutes */ , 15 /*seconds*/);
DateTime startTime = DateTime.Now;

while (DateTime.Now - startTime < timeout)
{
    try
    {
        SqlCeReplication repl = new SqlCeReplication();

        repl.InternetUrl = "https://www.adventure-works.com/sqlmobile/sqlcesa30.dll";
        repl.Publisher = "myPublisher";
        repl.PublisherDatabase = "AdventureWorks";
        repl.PublisherSecurityMode = SecurityType.NTAuthentication;
        repl.Publication = "AdventureWorks";
        repl.Subscriber = "Test";
        repl.SubscriberConnectionString = "Data Source='MyDatabase.sdf';Password='';";
        repl.Synchronize();
    }
    catch (SqlCeTransactionInProgressException)
    {
        Thread.Sleep(3000);
        continue;
    }
    catch (SqlCeLockTimeoutException)
    {
        //add your own error-handling logic here
    }
    catch (SqlCeException e)
    {
        MessageBox.Show(e.Message);
    }
}

상속 계층 구조

System.Object
   System.Exception
     System.SystemException
       System.Data.DataException
         System.Data.SqlServerCe.SqlCeException
          System.Data.SqlServerCe.SqlCeLockTimeoutException

스레드로부터의 안전성

이 형식의 모든 public static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.

플랫폼

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows XP Professional x64 Edition, Windows XP SP2

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Compact Framework

2.0에서 지원

참고 항목

참조

SqlCeLockTimeoutException 멤버
System.Data.SqlServerCe 네임스페이스