473,545 Members | 2,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how does SqlCommandBuild er maintain a row's key value

Hi,

The SqlCommandBuild er class seems to be able to remember
the primary key of a row such that even if I change that
key's value, it is still able to update only that row.
So I would like to know how can I update a row even when
the primary key is changed by the user? From the row's
columns' information the original information seems to be
lost so that I can specify to update only the row with
the original primary key.

Thanks for anyone's advise!
Jul 21 '05 #1
1 1328
The DataAdapter has a Diffgram that shows before and after values, actually
it's the dataset that has it, not the Adapter. So if you had a value of 1
in CustomerID for instance and you change it to 2, the effective query would
be Update MyTable Set CustomerID = 2 where CustomerID =1.
"Nick" <yk****@usc.edu > wrote in message
news:02******** *************** *****@phx.gbl.. .
Hi,

The SqlCommandBuild er class seems to be able to remember
the primary key of a row such that even if I change that
key's value, it is still able to update only that row.
So I would like to know how can I update a row even when
the primary key is changed by the user? From the row's
columns' information the original information seems to be
lost so that I can specify to update only the row with
the original primary key.

Thanks for anyone's advise!

Jul 21 '05 #2

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

Similar topics

3
29662
by: Jukka K. Korpela | last post by:
I have noticed that the meaning of visibility: collapse has been discussed on different forums, but with no consensus on what it really means. Besides, implementations differ. The specification says: "The 'visibility' property takes the value 'collapse' for row, row group, column, and column group elements. This value causes the entire row...
5
2829
by: microsoft.private.windows.netserver.setup | last post by:
I have a very strange thing occurring in the program. I have a dataset retrieved from a stored procedure that just select * from a table. I then try to use the SQlCommandBuilder on the dataset, and fails. I try the same select statement directly and not using a stored procedure and use SQLCommandBuilder, the program works. This is a ASP.net...
4
2126
by: Jim Reynolds | last post by:
Hi, I am using a SqlCommandBuilder to update a Db table via an updated DataSet and SqlAdapter and it doesn't seem to be generating the activity commands from the Select command. Here is a snippet. sda = new SqlDataAdapter(); sda.SelectCommand = new SqlCommand(sql,dbcon); SqlCommandBuilder scb = new SqlCommandBuilder(sda); DataSet ds =...
1
258
by: Nick | last post by:
Hi, The SqlCommandBuilder class seems to be able to remember the primary key of a row such that even if I change that key's value, it is still able to update only that row. So I would like to know how can I update a row even when the primary key is changed by the user? From the row's columns' information the original information seems to...
0
5788
by: Gancy | last post by:
Hi, I have data access tier designed in such a way, just by changnging application settings, same lines of code is made to work with both MS SQL Server or MS Access. Code works fine with MS SQL Server. however while executing following code lines on MS Acess ds = new DataSet(); oAdapter.SelectCommand.CommandText = this.SelectCommand;...
1
2078
by: andrewcw | last post by:
I have just 1 table that I am updating, the SQL I use to generate the DataTable is complex using multiple tables, however when I view the fieldnames of the DataTable from the DataSet - everything matches: What dont I understand here: ( The error I get is : Dynamic SQL generation is not supported against multiple base tables ). But My DataSet...
1
1782
by: love2livedislife | last post by:
I have a requirement as follows: while executing the procedure for first time i'll open a cursor and read the first row from it and return the value through OUT parameter of procedure without closing the cursor... during the second time execution of the same procedure i need the cursor to be opened so that i can read the second row during...
1
2047
by: bgernon | last post by:
I have a table that consists of two rows with three cells each row. The cells contain textboxes. I am able to successfully add a new row with textboxes when a button is clicked. The problem is retaining the newly added row with the filled in textboxes on the next button click. I think I am handling my viewstate incorrectly. This code adds...
0
1139
by: Tony Johansson | last post by:
Hello! This small program below works but I have some questions about it. Below I have a piece of code that update a specific row in the northwind database. The class SqlCommandBuilder is used for creating a suitable update,insert or delete sql command that match thisAdapter.
0
7502
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7946
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7457
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6026
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5360
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3491
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1045
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.