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
james james
NA
419
29.8k
Save to database
Aug 26 2017 11:05 AM
I am trying to save form1 to a databse in form2. when I save the form2 dataridview is blank. My message box says updated.
i have (tableBindingSource) (tableTableAdapter) (tableAdapterManager) and Database(TrailerInformation).
Form1
<
private void btnSave_Click(object sender, EventArgs e)
{
try
{
this.Validate();
this.tableBindingSource.EndEdit();
this.tableTableAdapter.Update(this.trailerInformation);
MessageBox.Show("Update successful");
}
catch (System.Exception ex)
{
MessageBox.Show("Update failed");
}
}
>
Form2
<
private void tableBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
Validate();
tableBindingSource.EndEdit();
tableAdapterManager.UpdateAll(trailerInformation);
}
private void DataBase_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'trailerInformation.Table' table. You can move, or remove it, as needed.
this.tableTableAdapter.Fill(this.trailerInformation.Table);
}
>
Attachment:
Form1.zip
Reply
Answers (
2
)
Execute application on system startup using Windows Service.
datagridview to pdf custom font