Hi,
the gridview was binded with available records only right then what is the use of searching again it is there are not ?
any how,
to test wheathere it is there are not and to delete follow the following one,
SqlConnection con=new SqlConnection ("connectionstring");
con.Open ();
SqlCommand cmd = new SqlCommand("select count(*) from tableName where cid=1233", con);
int i = 0;
i=(int)cmd.ExecuteScalar();
if (i > 0)
{
SqlCommand deleteCmd = new SqlCommand("delete tablename where cid=1233", con);
int res = 0;
res=deleteCmd.ExecuteNonQuery();
if (res > 0)
{
}
else
{
}
}
else
{
}