Here is the code you need to add/alter in order for it to work:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["PassConnectionString"].ConnectionString);
con.Open();
string cmdStr = "select count(*) from TableSecurity where EmailAddress= '" + TextBoxEA.Text + "'";
SqlCommand Checkuser = new SqlCommand(cmdStr, con);
int temp = Convert.ToInt32(Checkuser.ExecuteScalar().ToString());
if (temp == 1)
{
con.Close();
string cmdStr3 = "select Level from TableSecurity where EmailAddress= '" + TextBoxEA.Text + "'";
con.Open();
SqlCommand level = new SqlCommand(cmdStr3, con);
SqlDataReader reader = level.ExecuteReader();
DataTable dt1 = new DataTable();
dt1.Load(reader);
foreach(DataRow dr1 in dt1.Rows)
{
int returnedLevel = Convert.ToInt32(dr1[0].ToString());
if(returnedLevel == 1)
{
Response.Redirect("~/Secure.aspx");
}
else if(returnedLevel == 2)
{
Response.Redirect("~/WelcomeIALO.aspx");
}
}
}
con.Close();
}