Symptoms
Consider the following scenario in Microsoft Visual Studio 2008. You create a Windows Forms-based application. Next, you add a data source to this application by connecting to a Microsoft SQL Server Compact 3.5 database file. Then, you set one or more of the following properties to a value other than the default value: Connect TimeoutPacket SizeApplication NameNote The default value of the Connect Timeout property is 30. The default value of the Packet Size property is 4096. The default value of the Application Name property is SQL Server Compact ADO.NET Data Provider.
In this scenario, when you try to drag a table to the Windows form in the Data Sources window, you receive the following error message:
An error occurred while performing the drop:
Exception has been thrown by the target of an invocation.
Resolution
This behavior occurs because SQL Server 3.5 Compact does not support the connection tokens of the following properties in the runtime provider (System.Data.SqlServerCe.dll): Connect TimeoutPacket SizeApplication NameNotesVisual Studio 2008 adds the connection tokens of these properties to the runtime provider only if the values of these properties are not the default values. Therefore, if the values of these properties are the default values, the connection tokens of these properties are still valid.SQL Server Compact 3.5 supports connection tokens in the runtime provider and in the designtime provider. However, SQL Server Compact 3.5 supports different sets of connection tokens in each of these providers. In Visual Studio 2008, Visual Studio designers use the designtime provider. Therefore, the connection tokens of these properties are valid. However, when you drag a table to a Windows form, the code that performs the drag operation uses the runtime provider. Because SQL Server 3.5 Compact does not support the connection tokens for these properties in the runtime provider, the connection tokens are invalid.