473,401 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Problem Updating Database

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.

Nov 19 '05 #1
1 838
surely it is just reutrning the number of affected rows not the rows that
were affected?

HTH

Ollie Riches

"Justin" <Ju****@discussions.microsoft.com> wrote in message
news:BB**********************************@microsof t.com...
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.

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Steven Blair | last post by:
Hi, Here is a short decsription of my problem. I have written a dll for Database accessing. I have one method which can return a Dataset and another method which takes a Dataset and upates a...
0
by: Steven Blair | last post by:
Hi, Here is a short decsription of my problem. I have written a dll for Database accessing. I have one method which can return a Dataset and another method which takes a Dataset and upates a...
5
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
14
by: Lars Netzel | last post by:
A little background: I use three Datagrids that are in a child parent relation. I Use Negative Autoincrement on the the DataTables and that's workning nice. My problem is when I Update these...
11
by: SAL | last post by:
Hello, I have a Gridview control (.net 2.0) that I'm having trouble getting the Update button to fire any kind of event or preforming the update. The datatable is based on a join so I don't know...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.