473,388 Members | 1,399 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,388 software developers and data experts.

update sql unique key with dataadapter

I got a typed dataset of data from a Sql server and i binded them on a
grid, then if the user edit the grid all changes will be sent back
throw dataadapter.update.
The problem is that there is a unique key with three records and if
the user edit manually it switching values in the following way for
example:

original Intermediate editing final result
a ax ax ax ax b first record
b b bx bx c c second record
c c c a a a third reccord

The typed dataset will let him this editing but then when it'll update
obviusly the sql server'll give back instead an error about attemptig
of writing an already present unique key

How can i update avoiding this error?
Jul 21 '05 #1
1 1800
you decide, if this is required by system or this is outcome of some user's
play. or this is you want to test for your module.

in every case, you should make this unique column readonly in the grid.

and if you need to interchange the values of unique key anyhow. you need to
provide another interface for interchanging values of unique column.
Regards,

Rajesh Patel
"luudt" <la*****@freemail.it> wrote in message
news:b9**************************@posting.google.c om...
I got a typed dataset of data from a Sql server and i binded them on a
grid, then if the user edit the grid all changes will be sent back
throw dataadapter.update.
The problem is that there is a unique key with three records and if
the user edit manually it switching values in the following way for
example:

original Intermediate editing final result
a ax ax ax ax b first record
b b bx bx c c second record
c c c a a a third reccord

The typed dataset will let him this editing but then when it'll update
obviusly the sql server'll give back instead an error about attemptig
of writing an already present unique key

How can i update avoiding this error?

Jul 21 '05 #2

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

Similar topics

2
by: hch | last post by:
dataAdapter.Update(data, "TableName") won’t work! I was about to deploy my first website on the Internet only to discover that the dataAdapter.Update() throws the Server Error in the third...
4
by: João Santa Bárbara | last post by:
Hi all i have a problem with my sql dataadapter, i think. i have this table below ( Script ) and this table has one particularity, it has 2 unique constraints. when i´m filling my datatable...
2
by: Mojtaba Faridzad | last post by:
Hi, Please check these lines: DataSet dataSet = new DataSet(); dataAdapter.Fill(dataSet, "mytable"); DataRow row; row = dataSet.Tables.Rows; row.BeginEdit(); row = "555";
3
by: JacksonYin | last post by:
1. I can fill data from Excel to DataSet like this: OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=../../Book1.xls;Extended Properties=Excel...
4
by: CaptRR | last post by:
I think this is the right group to post to, so here goes. My problem is this, I cannot update the datarow to save my life. Been on this for 2 days now, and still am no closer to figuring it out...
3
by: Jerry | last post by:
Well, here is some weirdness. First, I noticed that I have 2 Set keywords (silly me). so I removed the 2nd "Set" but still got a syntax error. Then I removed the Where clause, and now it works...
11
by: Siv | last post by:
Hi, I seem to be having a problem with a DataAdapter against an Access database. My app deletes 3 records runs a da.update(dt) where dt is a data.Datatable. I then proceed to update a list to...
2
by: luudt | last post by:
I got a typed dataset of data from a Sql server and i binded them on a grid, then if the user edit the grid all changes will be sent back throw dataadapter.update. The problem is that there is a...
8
by: Zorpiedoman | last post by:
I keep getting a concurrency exception the second time I make a change and attempt to update a dataadapter. It appears this is by design, so there must be something I can do to avoid it. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.