protected void Button1_Click1(object sender, EventArgs e) { name = TextBox1.Text.Trim(); pwd = TextBox2.Text.Trim(); conn.Open(); MySqlCommand cmd = new MySqlCommand("select ln.UName, ln.UPasword, ut.UserType_ID from login ln, UserType ut where ln.UName = '" + name + "' and ln.UPasword = '" + pwd + "' and ln.UserType_ID = ut.UserType_ID"); cmd.Connection = conn; MySqlDataReader dr = cmd.ExecuteReader(); if ( dr.HasRows ) { dr.Read( ); Session[ " UName" ] = dr[ 0 ].ToString( ); Session[ " UPasword" ] = dr[ 1 ].ToString( ); Session[ "UserType_ID" ] = dr[ 2 ].ToString( ); } if (dr[2].ToString() == "1") { Response.Redirect( "View_Reports.aspx" ); } else { Response.Redirect( "gallery.aspx" ); } dr.Close(); conn.Close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)