Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > BOOK: Beginning VB.NET Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning VB.NET Databases
This is the forum to discuss the Wrox book Beginning VB.NET Databases by Thearon Willis; ISBN: 9780764568008
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning VB.NET Databases 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 March 18th, 2009, 12:15 PM
Authorized User
 
Join Date: Jan 2009
Posts: 21
Thanks: 4
Thanked 0 Times in 0 Posts
Question CANNOT CREATE A DATAROW OBJECT FROM A DATASET OBJECT

Can some one HELP,

I am working in Chapter 10 of Beginning VB.NET Database Programming. I am calling a function from my business logic layer and it gets a dataset schema and I see that the dataset is not null\nothing. But once I come back to the calling routine and I try to initialize a datarow to the dataset that was just created in the function call it is empty and I get an error because of the the null\nothing object reference, in this case the datarow object here is the code I am using
Code:
[:confused:]
'Get a new Project DataSet
objDataSet = objProjects.GetNewProjectDS()
 
'Initialize a datarow object from the Project DataSet
Dim objDataRow As DataRow =  _
objDataSet.Tables("Project").NewRow
Reply With Quote
  #2 (permalink)  
Old March 20th, 2009, 06:29 AM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Please check your code against the downloaded code. I ran the project and got no such error. The datarow was properly initialized.

Thearon
Reply With Quote
  #3 (permalink)  
Old March 20th, 2009, 10:14 AM
Authorized User
 
Join Date: Jan 2009
Posts: 21
Thanks: 4
Thanked 0 Times in 0 Posts
Red face Misspelled Table Name in Command

Sorry,

I misspelled the Table Name in the dataset therefore the table was not found in the dataset and the object could not be initialized and I got an error. I was able to track this down by using an IF Block to test for the Table Name in the Dataset. Once I realized it was not there I checked the spelling and found the error. Thanks for your help....
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
Can we use same Dataset Object? gaurav_jain2403 VS.NET 2002/2003 6 February 3rd, 2006 01:49 AM
create a Line object ,Box object in CR at Runtime? thanhnt Pro VB 6 1 May 16th, 2005 06:51 AM
DataRow Or Class Object? RM82 BOOK: ASP.NET Website Programming Problem-Design-Solution 3 June 11th, 2004 09:12 PM
Newbie who needs help with DataSet object!!! rboyle ADO.NET 1 March 10th, 2004 08:25 PM



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


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