I made a method that will execute query, I only need to know if it returns true or false
public bool CheckData(string sql)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["FabFlabs"].ToString());
con.Open();
SqlCommand cmd = new SqlCommand(sql, con);
cmd.ExecuteNonQuery();
con.Close();
bool setYN =?
return setYN ;
}
The query is something like select email from Admin where email = ''
Is there a better way to structure the query?