using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
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.SqlClient;
public partial class billing1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
}
protected void Button3_Click(object sender, EventArgs e)
String qry="select * from adminlogin where username=@username and password=@password";
SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|Datadirectory|\billing.mdf;Integrated Security=True;User Instance=True");
SqlCommand cmd = new SqlCommand(qry,con);
SqlDataReader rdr;
cmd.Parameters.AddWithValue("@username", textbox3.Text);
cmd.Parameters.AddWithValue("@password", textbox4.Text);
con.Open();
rdr = cmd.ExecuteReader();
if (!rdr.HasRows)
con.Close();
Label2.Visible = true;
return;
rdr.Read();
Session["Loginid"] = rdr[0].ToString();
Response.Redirect("~\\billing2.aspx");
using System.Configuration;
public partial class billing2 : System.Web.UI.Page
protected void Button1_Click(object sender, EventArgs e)
string str = "select count(*) from ssss where uname=@uname";
SqlCommand cmd = new SqlCommand(str, con);
cmd.Parameters.AddWithValue("@username", textusername.Text);
Label1.Visible = true;
if (Convert.ToInt32(cmd.ExecuteScalar()) == 0)
string qry = "insert into ssss values(@uname,@pwd,@cnpwd)";
SqlCommand cmd2 = new SqlCommand(qry, con);
cmd2.Parameters.AddWithValue("@uname", textusername.Text);
cmd2.Parameters.AddWithValue("@pwd", textpassword.Text);
cmd2.Parameters.AddWithValue("@cnpwd", TextBox1.Text);
cmd2.ExecuteNonQuery();
Response.Redirect("~\\billing6.aspx");