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 : SqlCeException

The SqlCeLockTimeoutException type exposes the following members.

Protected methodSqlCeLockTimeoutExceptionConstructor that helps in serialization.

Public propertyData (inherited from Exception)
Public propertyErrorCode (inherited from ExternalException)
Public propertyErrorsGets a collection of one or more SqlCeError objects that contain detailed information about exceptions generated by the .NET Compact Framework Data Provider for SQL Server Compact. (inherited from SqlCeException)
Public propertyHelpLink (inherited from Exception)
Public propertyHResultGets the HRESULT value of the exception. This value is the same as the value of HResult for the first instance of SqlCeError in the SqlCeErrorCollection for the exception. (inherited from SqlCeException)
Public propertyInnerException (inherited from Exception)
Public propertyMessageGets the text describing the first instance of SqlCeError in the SqlCeErrorCollection for this exception. (inherited from SqlCeException)
Public propertyNativeErrorGets the native error number of the first SqlCeError in the SqlCeErrorCollection. For more information about the error, see the "SQL Server Compact Errors" topic in the Troubleshooting section of SQL Server Compact Books Online. (inherited from SqlCeException)
Public propertySourceGets the name of the OLE DB provider that generated the error. (inherited from SqlCeException)
Public propertyStackTrace (inherited from Exception)
Public propertyTargetSite (inherited from Exception)

Public methodEquals (inherited from Object)
Protected methodFinalize (inherited from Object)
Public methodGetBaseException (inherited from Exception)
Public methodGetHashCode (inherited from Object)
Public methodGetObjectDataSecurity Critical. Populates a SerializationInfo with the data needed to serialize the object. (Overrides SqlCeException.GetObjectData(SerializationInfo, StreamingContext).)
Public methodGetType (inherited from Exception)
Protected methodMemberwiseClone (inherited from Object)
Public methodToString (inherited from Exception)

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

        TimeSpan timeout = new TimeSpan(0 /*hours*/, 0 /* minutes */ , 15 /*seconds*/);
        DateTime startTime = DateTime.Now;

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

                repl.InternetUrl = "http://www.adventure-works.com/sqlmobile/sqlcesa35.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 (SqlCeTransactionInProgressException)
            catch (SqlCeLockTimeoutException)
				//add your own error-handling logic here
            catch (SqlCeException e)

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft