A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Setting up and Configuration
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

.NET 2.0 COM Excel add-in stops responding when SqlConnection object is created



 
 
Thread Tools Display Modes
  #1  
Old August 24th, 2006, 04:35 PM posted to microsoft.public.dotnet.datatools,microsoft.public.dotnet.framework.adonet,microsoft.public.excel,microsoft.public.excel.programming,microsoft.public.excel.sdk,microsoft.public.excel.setup,microsoft.public.excel.templates,microsoft.public.excel.wor
Johan Zietsman
external usenet poster
 
Posts: 1
Default .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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:29 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.