TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
hsm2100
NA
1
0
A problem with the tableAdapterManager in a master-details form
Jul 16 2008 4:33 PM
Hello,
I am writing an application in visual studio 2008 and I have the Dataset connecting to a SQL server 2005 with 2 tabes : Check( chkID,ChkAmount) and checkDetails (chkDetailsID,ChkID,Amount,Deduction). Each table has its ID of autonumber type.
I have a master details form for these 2 tables when I add a new check record it is automatically assigned an temporary ID -1 untill it is saved in the database when I add a checkDetails record for this new added check it is given in the foreign Key "chkID" a value of -1 also
The problem when I press the save button which has the following code it raises an exception at the tableAdabtermanager.UpdateAll statement
private void checkBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.checkBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.eshpetcoDBSDataSet);
}
The exception of type sqlexception says The INSERT statement conflicted with the FOREIGN KEY constraint "Check_CheckDetails_FK1". The conflict occurred in database "EshpetcoDBS", table "Finance.Check", column 'chkID'.
The statement has been terminated.
I understand that the tableadaptermanager should handle the order of inserts and updates.but I dont know why it isnt working
Reply
Answers (
0
)
I need help with E-mail
crystal report XI