|
Subject:
|
Beginning VB.NET 2003 Chapter 16
|
|
Posted By:
|
siegmeister
|
Post Date:
|
5/26/2006 9:43:52 AM
|
Sorry for the post,... I am new to programming (trying to learn). Anyway, I was doing the DataSet example in Chapter 16, but I cannot get it to work. I downloaded the code from your website and got the same Microsoft Development Environment Error displaying the following message:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information: System error.
I seems to be bombing on the Open Database command - objConnection.Open()
Have you seen this before with the code samples? Any guidance would be appreciated.
|
|
Reply By:
|
siegmeister
|
Reply Date:
|
5/26/2006 11:36:48 AM
|
I should add that I am running SQL Server 2005 on the same box that I am trying to program on. Also, I verified that I do indeed have the pubs database, and I can connect to it fine otherwise. I tried a new project in VB and ammended the parameters to get data from the Northwind database and got the same error.
I googled the error, but the only results referenced making the DB call before you pass the parameters, but this referred to SQL 7.0
|
|
Reply By:
|
Thearon
|
Reply Date:
|
5/29/2006 1:28:05 PM
|
I tried to make a connection to SQL Server 2005 on one machine from Visual Basic 2003 on another machine and it failed with just some undescriptive error message. I tried again from Visual Basic 2005 and it failed again. However, this time it gave me a message indicating that the Named Pipes protocol might not be enabled. I went to the SQL Server 2005 machine and opened the SQL Server Configuration Manager and sure enough, on a default installation the Named Pipes protocol is disabled.
I enabled this protocol, restarted SQL Server, and was able to successfully connect from both Visual Basic 2003 and Visual Basic 2005.
I hope this helps.
Thearon
|
|
Reply By:
|
KalluMama
|
Reply Date:
|
11/30/2006 11:55:43 AM
|
i tried this method...but still could not connect...
|
|
Reply By:
|
KalluMama
|
Reply Date:
|
11/30/2006 12:05:29 PM
|
i used the wizard to get a connection string and then pasted it into my code. That worked
"workstation id=xxx;packet size=4096;user id=sa;integrated security=SSPI;da" & _ "ta source=""xxx\SQLEXPRESS"";persist security info=False;initial catalog=pu" & _ "bs"
|
|
Reply By:
|
Thearon
|
Reply Date:
|
12/5/2006 7:06:14 PM
|
Ah...
Your source part of the string indicates that you are running SQL Server Express as a named instance.
I'm glad you are up and working.
Thearon
|
|
Reply By:
|
jay lalita
|
Reply Date:
|
12/15/2006 7:07:51 AM
|
sdfsdfsdfewrwerter
jaya
|