Dynamically bind data and values to checkboxlist from sql server

M

mtelinc

Hi,

i am totally stuck. Here is the scenario

I have an asp.net page(c#), and need to implement the following.

I have a checkbox list that I am generating dynamically.

Based on a certain category, I am displaying the associated fields
already populated in DB. Lets say for examply category is Technology,
and the checkboxes that are pulled are: Software, Hardware, and Testing
(these are "fields")

DataSet dsFields= Field.GetFields("Technology");

foreach (DataRow datarow in dsFields.Tables[0].Rows)
{


cblTechnology.Items.Add(datarow["FieldName"].ToString());
}

Now On click button, I have to get the checked values, and write them
to sql server. My table structure is as follows:

TableCategory
-CategoryId
-CategoryName

TableField
-FieldId
-FieldName
-CategoryId (fk)

Table_User_Field
-Id
-UserId(fk)
-FieldId(fk)

I need to write the c#.net and 2 sql procedures to write the checkbox
values to the db and to read it back

Step1:
-Get selected checkbox values from asp.net page, and wirte them to db,
based on Userid

Step2:
-Based on the UserId and industry, get all the fields for that
industry, and then check all the ones that the User has selected

I need the c# and sql!!


HELP!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top