Problem Updating Database

G

Guest

I am using sql parameters to attempt to update a table but but no matter what
"CustomerId" is only the first row in the table is being updated instead of
the row specified, here is the abreviated code :

Me.SqlUpdateCommand1.CommandText = "UPDATE Queue SET January = @January,
March = @March, April = @April, May = @May, " & _
"June = @June, July = @July, August = @August, September =
@September, October = " & _
"@October, November = @November, December = @December, February
= @February WHERE CustomerId = @CustomerID"

Me.sqlDataAdapter1.Fill(DataSet1, "Queue")

Dim QueueRow As DataRow = DataSet1.Tables("Queue").Rows(0)
QueueRow(month) = ProductList.ToString()

Me.sqlDataAdapter1.Update(DataSet1, "Queue")

Me.SqlUpdateCommand1.Parameters.Add("@CustomerId",
System.Data.SqlDbType.Int, 255, "CustomerId").Value = myCustomerID

Any ideas?

Thanks, Justin.
 
O

Ollie Riches

surely it is just reutrning the number of affected rows not the rows that
were affected?

HTH

Ollie Riches
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,123
Latest member
Layne6498
Top