Maneesh A N

Maneesh A N

  • NA
  • 179
  • 108.6k

return chklist

Sep 26 2014 12:43 PM
hi

     i need to get 'testid' from checkboklist....now there is certain values in chklist         


private void btnsave_Click(object sender, EventArgs e)
{
fntestbookinsave(); 



Class1.connect();
SqlCommand cmd = new SqlCommand();
SqlDataAdapter sda;
sda = new SqlDataAdapter("prcmaxbookid", Class1.con);
DataTable dt = new DataTable();
sda.Fill(dt);
string str=dt.Rows[0][0].ToString();

string retval = string.Empty;
try{
foreach(string item in chkList1.Items)
{
if(item.selected)
{
retval += item.value+ ',';
}
retval.TrimEnd(',');
}
}
catch(Exception)
{
}
return retval;
}







string interests = string.Empty;


foreach (string item in chkList1.CheckedItems)
{
SqlDataAdapter adp = new SqlDataAdapter("prcbookingtestsave", Class1.con);
adp.SelectCommand.CommandType = CommandType.StoredProcedure;
adp.SelectCommand.Parameters.Add("@ibookingid", SqlDbType.Int).Value = str;
//adp.SelectCommand.Parameters.Add("@itestid", SqlDbType.Int).Value =item;
//adp.SelectCommand.Parameters.Add("@itestid", SqlDbType.Int).Value = strr;
DataSet ds = new DataSet();
adp.Fill(ds);
}
MessageBox.Show("TEST BOOKED");
fnclear();