|
-
May 1st, 2002, 02:31 PM
#2
You can loop through the dataset and submit your own Command Object.
-- Side topic. If you are using SQL Server, use the SQL specific objects.
For best performance I would use a stored procedure to do all the updating. However, you can loop through the dataset tables and execute an update.
somthing like:
Dim i As Integer
Dim the_id As String
Dim scmd As SqlCommand
For i = 1 To ds.Tables.Item("blah").Rows.Count
the_id = ds.Tables("blah").Rows.Item(i).Item("idColumn")
scmd = New SqlCommand("UPDATE table SET field='" & sometext & "' where id=" & the_id, CONN_STRING)
scmd.ExecuteNonQuery()
Next
This *should* work but you may have to play with the rows collection to get the values you need.
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
|