
June 7th, 2005, 03:51 AM
|
|
Registered User
|
|
Join Date: Jun 2005
Posts: 1
Time spent in forums: 3 m 3 sec
Reputation Power: 0
|
|
|
datatable to access db insert
hi all,
am new to posting, but this one's kinda got me beat. as you can tell from the following code, i'm still a newbie & everything that i've read is circling around in my head not landing anywhere.
i'm building an e-commerce website (isn't everyone), and the following insert command inserts the correct number of selections - say x number of items, but in the db, each row is exactly the same. do i need to tell it to release the first value? i've tried using a counter for each iteration, but with the same results.
-----------------------
Dim cmd3 As New OleDb.OleDbCommand("INSERT INTO tblOrderDetails(OrderID, ProductID)VALUES('" & OrderID & "','" & row("ProdNum") & "')", New OleDb.OleDbConnection(strConn))
cmd3.Connection.Open()
For Each row In dtable.Rows
cmd3.ExecuteNonQuery()
Next
cmd3.Connection.Close()
----------------
any help will be dearly appreciated.
sherri
|