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
dhivya pm
NA
10
19k
how to set accept in cell(2) after selecting in gridview
Apr 2 2013 2:01 AM
i have to set status as accept,reject for customer,while registering status while be pending. i need ,if condition for this, which row is selected then corressponding event should change in database as accept or reject
protected void Button2_Click(object sender, EventArgs e) {
SqlCommand cmd = new SqlCommand("select * from Testing", OIMS_01);
SqlDataAdapter ad = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
ad.Fill(ds);
if (GridView1.SelectedRow != null)
{
ds.Tables(0).Rows(0).Item(0) = GridView1.SelectedRow.Cells(1).Text;
ds.Tables(0).Rows(0).Item(1) = GridView1.SelectedRow.Cells(2).Text;
ds.Tables(0).Rows(0).Item(2) = "Accept";
}
else
{
ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Please select a row.')", true);
}
ad.Update(ds);
}
Reply
Answers (
1
)
issue with check box behaviour in datagridview in c#.
sessions in an array