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; namespace WebRole1 { public partial class Userlogin : System.Web.UI.Page { SqlConnection con = new SqlConnection(@"Data Source=RAVI;Initial Catalog=multicloud;user id=sa;password=123456"); protected void Page_Load(object sender, EventArgs e) { } protected void LinkButton1_Click(object sender, EventArgs e) { con.Open(); SqlCommand comm = new SqlCommand("select * from users where username='" + TextBox1.Text + "' and password='" + TextBox2.Text + "'", con); SqlDataReader drr = comm.ExecuteReader(); if (drr.Read()) { Label1.Visible = false; drr.Close(); SqlCommand comm1 = new SqlCommand("select * from users where username='" + TextBox1.Text + "' and password='" + TextBox2.Text + "' and status='YES'", con); SqlDataReader drr1 = comm1.ExecuteReader(); if (drr1.Read()) { Session["username"] = TextBox1.Text; Response.Redirect("Home.aspx"); } else { Label2.Visible = true; Label1.Visible = false; } } else { Label1.Visible = true; Label2.Visible = false; } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)