Click here to Skip to main content
15,917,731 members

Comments by 143Deepak (Top 35 by date)

143Deepak 20-Aug-12 12:07pm View    
i know sir,but doing like that the code will get big .is there any way or by using any type of loop which return only checked or unchecked no. of checkbox,please go through this code it need any modification than please do it.


void LoadCheckList()
{
string intersts = "";
SqlCommand cmd = new SqlCommand("Select Interests from Demo", cn); // Write your Query i have taken as sample
SqlDataReader dr;
cn.Open();
dr = cmd.ExecuteReader();
if (dr.Read())
{
intersts = dr["Interests"].ToString();
}
cn.Close();
string[] arr = intersts.Split(',');
foreach (ListItem item in this.CheckBoxList1.Items)
{
foreach (string s in arr)
{
if (item.Text== s)
{
item.Selected = true;
}
}
}
}
143Deepak 20-Aug-12 11:22am View    
sir if u dont mind,will u like to guide me that how to get the checkbox value(checked or unchecked) please provide me a block of code.for inserting data.
143Deepak 20-Aug-12 10:22am View    
sir,i already have the table columns of boolean data types,but i did not understand how to bind the particular checkbox to specific column,and how to get the value at once from groupbox,sir please guide me.
143Deepak 11-Aug-12 10:02am View    
sir i dont understand,what do want to explain,will u like to clear it.
143Deepak 7-Aug-12 5:18am View    
but sir to pivot a table ,the column should be integer on which the aggregations will be applied and i have all of my column in char or varchar.

i tried much after reading your solution but did not get what i want.

know what to do?