error is because you are reading a variable which is declared in class.
improve your solution, pass email to Login() function. Instead of returning a DataReader. return a table or row. eg.
public static DataTable GetTable(SqlCommand cmd)
{
DataTable tbl = null;
SqlConnection conn = null;
try
{
conn =
cmd.Connection = conn;
tbl = new DataTable();
SqlDataReader dr = cmd.ExecuteReader();
tbl.Load(dr);
dr.Close();
dr.Dispose();
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (conn != null)
{
conn.Close();
}
}
return tbl;
}
protected void Button1_Click(object sender, EventArgs e)
{
string email = TextBox3.Text;
SqlCommand cmd = new SqlCommand();
cmd="select client_pwd from Register where email='" + email + "'"
DataTable tbl = ba.GetTable(cmd)
if (tbl == null && tbl.Rows.Count == 0)
{
Label4.Text="Invalid User";
}
else
{
}