Hello friend, try the following code changes:
string cmdStr = "Select count(*) from Table22 where EmailAddress=@TextBoxEA";
SqlCommand sqlCmd = new SqlCommand(cmdStr, con);
sqlCmd.Parameters.Add("@TextBoxEA", TextBoxEA.Text);
int userExists = (int)sqlCmd.ExecuteScalar();
You have missed to add the Connection object with the SqlCommand object.