SQL Server Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘connection’

FIX: Query Using Nested IN and a CASE Clause Causes an Access Violation

Symptoms
Running a query with two or more nested IN clauses and a CASE statement may cause the connection to be broken and the following error to be returned:

ODBC: Msg 0, Level 19, State 1
SqlDumpExceptionHandler: Process 7 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.Connection Broken
Resolution
The query caused a handled exception in SQL Server, and the process was stopped.

Error message when you try to drag a table from a SQL Server Compact 3.5 database file to a Windows form in Visual Studio 2008: “An error occurred while performing the drop: Exception has been th …

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.