Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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 : SqlCeException
public class SqlCeLockTimeoutException extends SqlCeException
public class SqlCeLockTimeoutException extends SqlCeException

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

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 = "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='';";
        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
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 .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Compact Framework

Supported in: 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.