If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
.NET 2.0 COM Excel add-in stops responding when SqlConnection object is created
Dear All
I have encountered a problem when creating a System.Data.SqlClient.SqlConnection in my Excel add-in. I am using: - Visual Studio 2005 - Excel 2003 SP2 I created the add-in with the VS2005 Shared Add-in Wizard. I then included the required Office and Microsoft.Office.Interop.Excel assembly references. In the OnConnection method I add two buttons to the Excel menu. In the first button (called createSqlConnectionButton) I do the following: System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(); In the second button (called createOleDbConnectionButton) I do the following: System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(); I attach the code to this post. When I press the createOleDbConnectionButton to execute its event handler, everything works fine. When I press the createSqlConnectionButton to execute its event handler, it also executes, but after that, the add-in does not respond to any user interaction from these buttons any more. Any help on this will be greatly appreciated. Kind regards Johan Zietsman |
Thread Tools | |
Display Modes | |
|
|