Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003
This is the forum to discuss the Wrox book Professional VB.NET 2003 by Bill Evjen, Billy Hollis, Rockford Lhotka, Tim McCarthy, Jonathan Pinnock, Rama Ramachandran, Bill Sheldon; ISBN: 9780764559921
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 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
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 4th, 2003, 12:58 PM
Authorized User
 
Join Date: Jun 2003
Location: Cowes, IOW, United Kingdom.
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to JonathanC
Default Open for help

Hi All

Just to let you know that any questions posted here will be looked at :)

Hope you all enjoy the book



Jonathan Crossland
http://www.jonathancrossland.com
__________________
Jonathan Crossland
http://www.jonathancrossland.com

NOT a Wiley/Wrox employee
  #2 (permalink)  
Old June 14th, 2003, 11:58 AM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just finished doing the Try It Out - DataSet Examples in Chapter 16, and I am getting this error. I searched everywhere to see if anyone else in the world got this error, and I found a handful, so i figured, why not ask the authors for help :)

Here is the error

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

Additional information: System error.
"

When I Debug, It highlights this line:
 'Fill the dataset object with data...
        myDataAdapter.Fill(myDataSet, "authors")

Any help will be very much appreciated, please!

-Jovenal
  #3 (permalink)  
Old June 14th, 2003, 11:59 AM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Whoops, I copied the wrong line of code that was giving me the error.

Here is the line that gets highlighted:

        'Now execute the command...
        myDataAdapter.SelectCommand.ExecuteNonQuery()

Sorry for the confusion.
  #4 (permalink)  
Old June 15th, 2003, 11:21 PM
Authorized User
 
Join Date: Jun 2003
Location: Cowes, IOW, United Kingdom.
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to JonathanC
Default

Hi JovenaL

This sounds like your SQL Select statement is incorrect.
The error you get likely occurs because the name of a table or field
is incorrect.
I have pasted the code from my version of the code. Look for the difference between yours and the code below.


'Start ................

  objDataAdapter.SelectCommand.CommandText = _
            "SELECT au_lname, au_fname, title, price " & _
            "FROM authors " & _
            "JOIN titleauthor ON authors.au_id = titleauthor.au_id " & _
            "JOIN titles ON titleauthor.title_id = titles.title_id " & _
            "ORDER BY au_lname, au_fname"
        objDataAdapter.SelectCommand.CommandType = CommandType.Text


'end ..............

I think its very likely that it is an error caused by a typo.

Please Let me know if this is the case.




Quote:
quote:Originally posted by JovenaL
 Whoops, I copied the wrong line of code that was giving me the error.

Here is the line that gets highlighted:

        'Now execute the command...
        myDataAdapter.SelectCommand.ExecuteNonQuery()

Sorry for the confusion.
Jonathan Crossland
http://www.jonathancrossland.com
  #5 (permalink)  
Old June 16th, 2003, 12:12 PM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Doh.....i forgot an underscore hahah
THanks for the quick reply...
  #6 (permalink)  
Old June 16th, 2003, 06:19 PM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

question.
I need to make a function that deletes a row from an existing SQL Server 2000 Database.
I know I need to implement an SQL DataAdapter, as well as New Dataset.
My syntax for the SQL is correct, but I am getting the same error I got with my first question.

Error on this line
myDataAdapter.SelectCommand.ExecuteNonQuery()

Please help!
  #7 (permalink)  
Old June 19th, 2003, 04:48 AM
Authorized User
 
Join Date: Jun 2003
Location: Cowes, IOW, United Kingdom.
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to JonathanC
Default


If you have SQL tools, it may be helpful to write your sql in Query Analyzer. Then you will be sure that the statement works.

Then when you put the statement into your code, you will know whether the error is in the syntax of your SQL or in your code.

I suspect, that you have another tpyo :)
Assuming of course that the code is right.

After checking your syntax, if you are still getting the error, post the bit of source code up here so that I can see it. It will help in trying to help you get round this problem.




Jonathan Crossland
http://www.jonathancrossland.com
 


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
Open Form, run query, open form Grafixx01 Access 7 April 26th, 2007 11:32 AM
Open document, Open second doc and copy to first justabeginner Word VBA 1 March 7th, 2007 02:47 AM
asp can't open db when db open by other program datuk Classic ASP Professional 3 June 13th, 2006 06:10 PM
Open the "Open File" dialogue box piratelordx Access VBA 4 March 14th, 2006 10:08 PM
Attempted to open a database that is already open person747 Access 10 September 3rd, 2004 04:31 PM



All times are GMT -4. The time now is 12:08 AM.


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