Hi all,
i am developing web application in asp.net backend MS-Sql.<br/> i have to retrieve a particular table values for example table name "costomer" and its fields are "c_id,c_name,c_contactno" like that and when i retrieve this values, it should be bind the checkbox for UI. now i've code for generate check box but it is not working well. only display single column c_id or C_name or C_contact number. but, i have to display all (c_id,c_name,c_contactno). i don't know how to do this, if anyone know please help me.
#region generate checkbox
public void generateckbox()
{
try
{
objAddValuesClass = new AddValuesClass();
table = new DataTable();
ds = new DataSet();
ds = objAddValuesClass.getmenuvalues();
table = ds.Tables[0];
for (int intControlIndex = 0; intControlIndex <= table.Rows.Count - 1; intControlIndex++)
{
CheckBox chkList1;
chkList1 = new CheckBox();
chkList1.Text = table.Rows[intControlIndex][0].ToString();
//chkList1.ID = table.Rows[intControlIndex][1].ToString();
chkList1.Font.Name = "Verdana";
chkList1.Font.Size = 9;
PnlControl.Controls.Add(chkList1);
PnlControl.Controls.Add(new LiteralControl(""));
}
}
catch (Exception exp)
{
throw new Exception(exp.Message);
}
}
#endregion
raajsj 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.