Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programmatically adding null values to a dataset

Status
Not open for further replies.

Zarcom

Programmer
May 7, 2002
1,275
CA
Hey guys

I was adding a row to a dataset using the overloaded addrow method using individual values. Thing is some of the values not needed or available at the time. You can't just leave them out you get a method doesn't support this number of arguments error. So I ended up putting Nothing in place of the unneeded variables.
This however, seems to mess a few things up.

My question then is how do you put null values into certain columns when you add a row to a dataTable. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Isn't there a System.Type.DbNull you can use? or something similar?
hth Daren J. Lahey
Just another computer guy...
If you are unsure of forum etiquette check here FAQ796-2540
 
dbNull is a type and can't be used as an expression.

However, I did manager to get it. Instead of using the addrow(value, value, value...) method I used the addrow(datarow) method.

Above that I just made a new datarow of the type i need and set the values of the columns I need. Not setting the other columns works just fine.

Thanks anyway That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top