I am reading values from database and assigning these values to combo but it didn't assign
try
{
objCls.objSqlCmd = new SqlCommand();
objCls.objSqlCmd.CommandType = CommandType.Text;
objCls.objSqlCmd.CommandText = "SELECT * FROM attributeValue WHERE attributeCode='" + attributeCode + "'";
objCls.objSqlCmd.Connection = clsObjects.objSqlCon;
clsObjects.objSqlDr = objCls.objSqlCmd.ExecuteReader();
while (clsObjects.objSqlDr.Read())
{
cmbDropDown.Items.Add(clsObjects.objSqlDr["v1"].ToString());
cmbDropDown.Items.Add(clsObjects.objSqlDr["v2"].ToString());
cmbDropDown.Items.Add(clsObjects.objSqlDr["v3"].ToString());
}
clsObjects.objSqlDr.Close();
}
catch (Exception ex)
{
clsFunction.CathExeption(ex);
}
Guest UserPosted Jul 10, 2014, 9:22 PM
- Did you try to see if it's going into While look?
- If yes, what's are there values in clsObjects?
- If yes, then is it throwing any Exception?
twitter @sumitjolly