Hi ,
If MsgID = 2 is not in datatabse then it gives out of range error. How to Check if ds not contain 3 then it will go to enable false statement.
if (ds.Tables[0].Rows[1]["MsgID"].ToString() == "1")
ddlBind.Visible = true;
else
ddlBind.Visible = false;
if (ds.Tables[0].Rows[2]["MsgID"].ToString() == "2")//1 exists in db it running well, when breakpoint comes here msgid=2 is not in db then it gives error of indexoutofrange in exception.How to to check if not exists then it goes to false.
ddlBind.Visible = true;
else
ddlBind.Visible = false;