HI
I have House_info table in database that have Pay column
I have one checkbox in admin.aspx page that I bind it from database
I want if there was data in pay column checkbox.cheked=true else checkbox.cheked=false
so in behind code I wrote below code
SqlCommand _cmd = new SqlCommand("ViewSreg", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cn.Open();
SqlDataReader _dr = _cmd.ExecuteReader();
while (_dr.Read())
{
if (_dr["Pay"] != null && _dr["Pay"].ToString() != " ")
{
ChkV.Checked = true;
}
_cn.close();
}
But in both condition if there was data in Pay column Or there wasn't any data in Pay column it checked checkbox.
I mean in both condition it is CHKV.cheked=true
Thanks