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
Mark Fenech
NA
82
69.2k
Updating in database with textboxes
Apr 27 2011 6:02 AM
Hi i am updating in database and im getting a "Object reference not set to an instance of an object" Exception.
This is my code :
public void UpdateMember(DataGridView dgv, TextBox t1, TextBox t2, TextBox t3, TextBox t4, TextBox t5, TextBox t6)
{
int i = dgv.CurrentRow.Index;
ds.Tables["dbo.tblMember"].Rows[i]["Name"] = t1.Text;
ds.Tables["tblMember"].Rows[i]["Surname"] = t2.Text;
ds.Tables["tblMember"].Rows[i]["Age"] = t3.Text;
ds.Tables["tblMember"].Rows[i]["Address"] = t4.Text;
ds.Tables["tblMember"].Rows[i]["Email"] = t5.Text;
ds.Tables["tblMember"].Rows[i]["Number"] = t6.Text;
da.Update(ds.Tables["tblMember"]);
MessageBox.Show("Updating Completed", "Updating", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
Reply
Answers (
5
)
support
Checkergame continuing