Remote access to mobile databases
Home | Products | Buy | Support | Downloads | Contacts | Forum | Blog Search

open all | close all

In version 1.6.700 of DesktopSqlCe you get a "System.NullReferenceException: Object reference not set to an instance of an object." exception when calling SqlCeConnection.BeginTransaction because of a very simple programming error in one of the SqlCeTransaction constructors. To solve it, open the SqlCeTransaction.cs file and look for the first constructor:

internal SqlCeTransaction(SqlCeConnection conn)

Now, exchange the two lines so it reads:

m_connection = conn;
Construct(conn.Pipe);

Recompile the assembly and run your application.