|
Hi,
I want to programmatically add a row to a datatable in my
dataset. I have a primary key that is an IDENTITY column in my
database. How do I do this? If I set the column value to
DBNull.Value I get an error about it not accepting nulls. If I
set it to 'nothing' it tells me to use dbnull. If I use "" I get
a cast problem from string to integer.
Sample Code:
Dim AddRow As DataRow
AddRow = MyDS.Tables("tools").NewRow
AddRow(0) = DBNull.Value '***problem line***
AddRow(1) = "Desc"
MyDS.Tables("tools").Rows.Add(AddRow)
I'm using VS .Net 2003. Thanks in advance.
|