Solved

Excel Add-in VB.net Problem connecting to SQL

Posted on 2013-11-28
3
308 Views
Last Modified: 2013-12-02
Hi. I am getting the error trying to connect to a SQL database from my VB.net Excel add-in.
This error hasn't come up in two years and has suddenly arisen after I installed Office 2013 alongside  my existing Office 2007. The error happens at the fourth line of the following code:


            Dim cn As New SqlConnection(oConnectionString)

            Dim adp As New SqlDataAdapter(SQLExpression, cn)

            Dim ds As New DataSet

            adp.Fill(ds, "SystemData") 'Error at this line

1
0
Comment
Question by:murbro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 39683635
Is the TCP/IP protocol enabled in your SQL Server?

Check this link: http://sqlanddotnetdevelopment.blogspot.in/2013/07/a-connection-was-successfully.html

Hope that helps.
0
 
LVL 9

Accepted Solution

by:
Valliappan AN earned 500 total points
ID: 39683637
Also check this link:

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_23725734.html

You may need to set priorities, or Named Pipes.
0
 

Author Closing Comment

by:murbro
ID: 39689661
Thanks for your help
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question