Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 18th, 2005, 06:01 PM
Registered User
 
Join Date: Feb 2004
Location: west nyack, ny, USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Page 638 Connection to SQL Server

I tried the exercise on page 638 of the book and got the following:

An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll

Additional information: System error.

I assume this is because I have done nothing to set up SQL Server on my machine. Can anyone give me help with this?

Thanks

Jerry OBrien
Reply With Quote
  #2 (permalink)  
Old January 18th, 2005, 06:14 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Not everyone here has “the book.” This is just users helping users.

Rather than referencing page numbers from the book, could you spell out what it is that you are doing, and what the results are?
Reply With Quote
  #3 (permalink)  
Old January 24th, 2005, 02:16 AM
Registered User
 
Join Date: Jan 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to mojomarc
Default

I have the exact same problem.

What we are doing in this particular exercise out of the book is setting up a datagrid and grabbing tables from the SQL "pubs" database to fill the datagrid. In order to do this, we first create a connection string ("server=(local);database=pubs;uid=sa;pwd=") which should work for connecting to the default local SQL Server 2000 installation, and then we open that connection (which is created as "myConnection"). When it gets to myConnection.open(), it creates the referenced system error. I have tried changing the connection string, thinking that was the problem, and even reinstalled SQL in case I did something stupid the first time I installed it, and I still get this error.

Help!

Reply With Quote
  #4 (permalink)  
Old January 24th, 2005, 02:48 AM
Registered User
 
Join Date: Jan 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to mojomarc
Default

Well, I solved the problem. The book left out (apparently) part of the connection string. When I added in the statement "integrated security=sspi" it worked perfectly. Hopefully this solves your problem too, Jerry.

Reply With Quote
  #5 (permalink)  
Old January 31st, 2005, 05:42 PM
Registered User
 
Join Date: Feb 2004
Location: west nyack, ny, USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Two things discovered first SQL Server is not set up on my machine and the company will not let me do it so I can not use the 'server=(local)" part of the command. BUT I did find a server I could connect to with the pubs database on it. THEN I changed the statement to connect as it appears below:

"SqlConnection("server=MXXSQLSVRYY;database=pubs;u id=employee_user;pwd=employee_user")

Where MXXSQLSVRYY is the server name I can connect to (The ( and ) were left out of the statement around the server name and employee_user is as I understand it an old Microsoft user id and password.
Where do you put the "integrated security=sspi" portion of the statement in the other solution posted?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Server Connection MonkeyMan666 C# 2 November 14th, 2008 10:44 AM
Connection to SQL Server brijxp ADO.NET 1 November 18th, 2006 08:34 AM
Sql server connection failed AcidHell2 All Other Wrox Books 0 February 26th, 2004 01:57 PM
SQL Server Connection mpeterson Classic ASP Databases 1 July 8th, 2003 09:50 PM
Connection with sql server arshad mahmood VB Databases Basics 1 June 19th, 2003 10:53 PM



All times are GMT -4. The time now is 11:04 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.