Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# MySQL
im trying to update and existing record by set value1=@value1 where value1 = value1
but its not working
Posted 7-Oct-12 23:18pm
Comments
Mohd. Mukhtar at 8-Oct-12 5:23am
   
Are you want to update primary key value?
mrDivan at 8-Oct-12 5:38am
   
yes it is an column that holds the primary key values i am trying to update that value
vivektiwari97701 at 8-Oct-12 5:28am
   
set value1=@value1 where value1 = @value1
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

If you are updating primary key then you need to make sure that no duplicate value should be inserted.
 
The other problem can be with the relationship if you are refering from any table to this table then you need to update that table first then you can update this table.
 
Check both the senario.
 
For the second senario, Either you can delete all the child rows or update child row.
 
If this not resolve you problem, Please copy the error what you getting while update.
  Permalink  
v4
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

You cannot update Identity Column Value.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

that is not proper question can u explain it ?
  Permalink  
Comments
CPallini at 8-Oct-12 5:50am
   
That is not a proper answer, could you explain it, please?
:-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 693
1 George Jonsson 370
2 BillWoodruff 317
3 Sergey Alexandrovich Kryukov 259
4 Garth J Lancaster 240
0 Sergey Alexandrovich Kryukov 10,764
1 Maciej Los 5,474
2 OriginalGriff 5,472
3 CPallini 3,819
4 BillWoodruff 3,594


Advertise | Privacy | Mobile
Web03 | 2.8.141030.1 | Last Updated 8 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100