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")
ddlBind.Visible = true;
else
ddlBind.Visible = false;