If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Mysql AutoInc & C# data column AutoInc. sync problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-18-11, 03:25
MrC MrC is offline
Registered User
 
Join Date: Sep 2007
Posts: 15
Mysql AutoInc & C# data column AutoInc. sync problem

dear sir

now i have a problem and searched a lot and did not find any working solution ,

now i have table with ID column which Primary Key & Auto Increment
now if the current ID is 5 and i enter a row then i deleted it , so the next new ID should be 7 not 6 OK but the VS 2005 C# after using databinding.addnew() the c# get the last ID which 5 and inc. it by one so it will be 6 not 7 so how the sync between Mysql Autoinc & C# autoinc

mysql autoinc. is normal and but the problem now in C# , the next new ID must be same in c# and mysql , i use also such ID in a linked table so the reuslt for example ID in Mysql is 6 but the ID generated in the c# is 5 and it stored in the linked table as 5 although in real it is 6 and no record with ID 5
Reply With Quote
  #2 (permalink)  
Old 05-18-11, 03:49
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 20,000
this does not appear to be a mysql problem
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Tags
auto increment, c#.net, mysql

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On