Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SqlCeLockTimeoutException Class

This exception is thrown if the lock timeout has been reached.

Namespace: System.Data.SqlServerCe
Assembly: System.Data.SqlServerCe (in system.data.sqlserverce.dll)

Public Class SqlCeLockTimeoutException
	Inherits SqlCeException
Dim instance As SqlCeLockTimeoutException

public class SqlCeLockTimeoutException extends SqlCeException
public class SqlCeLockTimeoutException extends SqlCeException
Not applicable.

For more information, see the topic "Locking (SQL Server Compact Edition)" in the SQL Server Compact Edition Books Online.

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

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

        repl.InternetUrl = "http://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='';"
    Catch exInProgress As SqlCeTransactionInProgressException
        GoTo ContinueWhile1
    Catch exTimeout As SqlCeLockTimeoutException
        ' Add your own error-handling logic here
         GoTo ContinueWhile1
    Catch e As SqlCeException
    End Try
End While


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

.NET Compact Framework

Supported in: 2.0

Community Additions

© 2015 Microsoft