using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.OleDb; public partial class index : System.Web.UI.Page { connection objconn = new connection(); OleDbConnection conn; protected void Page_Load(object sender, EventArgs e) { conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Domains\nid.edu\db\database.mdb;Persist Security Info=True"); //conn = objconn.getconn(); } protected void imgbtnLogin_Click(object sender, ImageClickEventArgs e) { OleDbCommand cmd = new OleDbCommand("select * from MemberMaster where UserId='" + txtUserId.Text + "' and password='" + txtPassword.Text + "'", conn); OleDbDataAdapter dap = new OleDbDataAdapter(cmd); DataTable dt = new DataTable(); int count = dap.Fill(dt); if (count != 0) { if(dt.Rows[0].ItemArray[35].ToString()=="sujitha" && dt.Rows[0].ItemArray[36].ToString()=="abc") { Session["userid"] = txtUserId.Text; Response.Redirect("adminuser.aspx"); } else { Session["UserId"] = txtUserId.Text; Response.Redirect("EditData.aspx"); } // Response.Redirect("/anumni/EditData.asp"); //lblRedirect.Text = "/anumni/EditData.asp"; // imgbtnLogin.Attributes.Add("onclick", "location.href=EditData.asp;"); } else { lblError.Visible = true; lblError.Text = "UserName or Password wrong"; } } }