|
-
Oct 10th, 2011, 10:12 AM
#3
Thread Starter
Addicted Member
Re: How do i populate datatable with listview
 Originally Posted by Shaggy Hiker
With a datatable, the first step is to create a new row:
Dim dr as DataRow = dt.NewRow
Then you can add the items to the row:
dr("Quantity") = ListView1.Items("Quantity")
dr("Description") = ListView1.Items("Description")
etc.
Finally, once you have put the values from the listview into the fields of the datarow where they belong, you have to add the row to the datatable:
dt.Rows.Add(dr)
That last step may seem a bit odd. Afterall, you created the datarow from the datatable, so why add it back in? Shouldn't the datatable already know about it? I don't have a good answer for that, but it is the case.
i tried your code sir but it gives me error. . . .How do i populate a datatable with my listview datas??. . . .is it possible??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|