|
-
Nov 28th, 2003, 01:43 PM
#1
Thread Starter
Hyperactive Member
which is faster for adding records?
using a datarow object or regular sql syntax such as..
Dim oCmdInsertSchool As New MySqlCommand("insert into school (name , db, host) values('" & txtSchool.Text & "', '" & txtDB.Text & "', '" & txtHost.Text & "')", oConn)
oCmdInsertSchool.ExecuteNonQuery()
rather than
dim orow as datarow
orow.items("name") = txtschool.text
thanks
-
Nov 28th, 2003, 03:12 PM
#2
It depends if how often/when you are updating the database or how many rows you are changing. If you want to change 10 rows in a row then a dataset and the second way would be faster than calling an update for each row. Also if you want to only update the database at selected times, in a delayed fashion, then the 2nd way could be faster but if you want to update immediately then go the first route.
-
Nov 28th, 2003, 03:16 PM
#3
Frenzied Member
Call a stored procedure and pass it the values needed.
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Nov 28th, 2003, 03:27 PM
#4
PowerPoster
Originally posted by Memnoch1207
Call a stored procedure and pass it the values needed.
Fastest way.
-
Dec 9th, 2003, 04:13 PM
#5
Fanatic Member
Could someone please post an example of a stored procedure that adds a new record to a database.
Thanks
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
|