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
Dhimesh Parmar
NA
126
14.6k
i can'n perform record update using RowUpdating in gridview?
Feb 28 2018 8:18 AM
protected void gridStud_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
LinkButton btn = (LinkButton)gridStud.Rows[e.RowIndex].FindControl("linkUpdate");
int studentId = Convert.ToInt32(gridStud.DataKeys[e.RowIndex].Value.ToString());
TextBox txtStudName = (TextBox)gridStud.Rows[e.RowIndex].FindControl("txtStud");
RadioButton rd1 = (RadioButton)gridStud.Rows[e.RowIndex].FindControl("RadioButton3");
RadioButton rd2 = (RadioButton)gridStud.Rows[e.RowIndex].FindControl("RadioButton4");
TextBox txtBirthdate = (TextBox)gridStud.Rows[e.RowIndex].FindControl("txtDate");
TextBox txtEmail = (TextBox)gridStud.Rows[e.RowIndex].FindControl("txtEmail");
TextBox txtMobile = (TextBox)gridStud.Rows[e.RowIndex].FindControl("txtmob");
studentCommon c = new studentCommon();
SqlCommand cmd = new SqlCommand("studIUD");
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("StatementType", "UPDATE");
// cmd.Parameters.AddWithValue("studentId", studentId);
cmd.Parameters.AddWithValue("name", txtStudName);
if (rd1.Checked)
{
cmd.Parameters.AddWithValue("gender", "Male");
}
else
{
cmd.Parameters.AddWithValue("gender", "Female");
}
cmd.Parameters.AddWithValue("brithDate", txtBirthdate);
cmd.Parameters.AddWithValue("emailid", txtEmail);
cmd.Parameters.AddWithValue("mobilenumber", txtMobile);
c.ExecuteNonQueryByCommand(cmd);
gridStud.EditIndex = -1;
gridStud.DataBind();
}
Reply
Answers (
8
)
Update Specific Textbox in sub Winform from External App
Ddisplay of a List into a ListBox does not work