Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding a row to a dataset
Message
From
06/08/2004 14:06:45
 
 
To
06/08/2004 13:48:36
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00931376
Message ID:
00931380
Views:
22
Can somebody tell me what is wrong with this code?

Dim rowNew As DataRow
rowNew = gModelTagsDS.Tables("header").NewRow()
rowNew("model") = Trim(txtModelNum.Text)
rowNew("modeldesc") = Trim(txtModelDesc.Text)
rowNew("partdesc") = desc
rowNew("quantity") = temp


I get an Object reference not set to an instance of an object error.


Hi, Mike,

Exactly which line is it dying on? Try tracing through it, and look at all of your variables and objects in the watch window. At least one of them hasn't been initialized, so it will probably show as 'null', 'undefined', etc.

Kevin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform