Click here to Skip to main content
14,303,069 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am using GridView with CheckBox.

I have two tables :

document and document_rights

document table have, user_id, category, subcat
document_rights have, user_id, category, subcat

First of all I want to show all the documents in GridView from the document table and when I give user rights for the particular id it not display CheckBox true.

When button click I use code behind:

GridView1.DataSource = c.getdata("select id,user_id,title from document where category='" + drop_cat.SelectedItem.Value + "' and subctgry='" + drop_sub_cat.SelectedItem.Value + "'");

And when I give rights to user I store with comma if more than one, user name and cat and subcat.

I also store user name with comma in according to in document table.

So I want to CheckBox true when user is selected from dropdown of user.

So what can I do in this case.... for check the CheckBox.
Updated 4-May-12 9:51am
I know what is a "cat", but trying to imagine a "subcat" I start feeling horror. :-)
ZurdoDev 7-May-12 19:52pm
What exactly is the question?
ZurdoDev 7-May-12 19:52pm
Reason for my vote of 1
Also, your SQL is open for SQL injection.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100