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
Madito Kevin
NA
8
1.9k
Update database record
Apr 26 2015 1:34 PM
i want to update tables for my database when i update one record from a table the second table must be updated automatically.
below is update button for my first table
private void btn_Update_Click(object sender, EventArgs e)
{
try
{
System.Data.DataTable dt2;
dt2 = ds.Tables["tblForce_N"];
this.assetdg.BindingContext[dt2].EndCurrentEdit();
this.da.Update(dt2);
MessageBox.Show("Data Update successfull", "Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
here is update button for my second table
private void button1_Click(object sender, EventArgs e)
{
try
{
System.Data.DataTable dt2;
dt2 = ds2.Tables["tblComp"];
this.assetdg.BindingContext[dt2].EndCurrentEdit();
this.da2.Update(dt2);
MessageBox.Show("Data Update successfull", "Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
when i click update from one table i want the second table to be updated automatically ,i'm using datagridview not text boxes to enter records.
Reply
Answers (
3
)
validations
.Net and C# Beginner