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
Indranil Sarkar
NA
4
1.8k
Template checkbox in Gridview is selected but returning false when running the code
Oct 26 2012 6:36 AM
I have used template CheckBox in gridview for multiple rows deletion, when I select multiple rows by selecting the CheckBox and perform the delete operation it seems to be selected CheckBox is not returning true on the code below.
protected void Button6_Click(object sender, EventArgs e)
{
foreach (GridViewRow row in GridView1.Rows)
{
LinkButton ch = new LinkButton();
ch = (LinkButton)row.FindControl("l1");
id = Convert.ToInt16(ch.CommandArgument);
CheckBox chs = new CheckBox();
chs = ((CheckBox)row.FindControl("c1"));
if (chs.Checked == true)
{
DeleteSelected(id);
}
}
}
private void DeleteSelected(short id)
{
var ch = from a in empd.Employees where (a.ID == id) select a;
empd.Employees.DeleteAllOnSubmit(ch);
empd.SubmitChanges();
display_emp();
}
Well now I have fixed the connection everything, please just refresh the database.Please get the web application in the below link.
<a href=http://www.ziddu.com/download/20716096/WebApplication.zip.html>http://www.ziddu.com/download/20716096/WebApplication.zip.html</a>
Please help me on why selected checkbox are not returning true in the code.
Reply
Answers (
1
)
Operand type clash: nvarchar is incompatible with image
i want to upload my website on web server,Can anybody tell me what will be my connection string for SqlExpress database?