473,402 Members | 2,064 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,402 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 1802
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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,...
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.