jxharding
asked on
add row and call its fieldname "ID" to dynamically created dataset
Hi, i want to create a Dataset dynamically,
no problem. i want to add a row called "ID" to my table "MyID"
the problem is adding the row.
i have Row(0) = and this does not work.
i also dont know how to call the row field "ID"
thanks!
Dim ds As New DataSet
Dim dt As New System.Data.DataTable("MyI D")
ds.Tables.Add(dt)
Dim I As Integer
For I = 0 To ListView1.Items.Count - 1
Dim row As DataRow = ds.Tables("MyID").NewRow()
row(0) = ListView1.Items(I).SubItem s(9).Text. Trim.ToUpp er
ds.Tables("MyID").Rows.Add (row)
Next I
ds.WriteXml("c:\1.xml")
no problem. i want to add a row called "ID" to my table "MyID"
the problem is adding the row.
i have Row(0) = and this does not work.
i also dont know how to call the row field "ID"
thanks!
Dim ds As New DataSet
Dim dt As New System.Data.DataTable("MyI
ds.Tables.Add(dt)
Dim I As Integer
For I = 0 To ListView1.Items.Count - 1
Dim row As DataRow = ds.Tables("MyID").NewRow()
row(0) = ListView1.Items(I).SubItem
ds.Tables("MyID").Rows.Add
Next I
ds.WriteXml("c:\1.xml")
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.