SlideShare a Scribd company logo
1 of 12
Download to read offline
//program files
//admin.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace RegistrationUsers
{
public partial class Admin : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("WebForm1.aspx");
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("view users.aspx");
}
}
}
//view users.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace RegistrationUsers
{
public partial class view_users : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
//webform1.aspx.cs
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;
namespace RegistrationUsers
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
/* if (IsPostBack)
{
String cs = ConfigurationManager.ConnectionStrings["Data Source =
ADMINIB - 83V87D2; Initial Catalog = employee; Integrated Security = True; Connect
Timeout = 15; Encrypt = False; TrustServerCertificate = True; ApplicationIntent = ReadWrite;
MultiSubnetFailover = False"].ConnectionString;
SqlConnection connection = new SqlConnection(cs);
connection.Open();
string checkuser = "select count(*) from Users where Username=" +
TextBox1.Text + "'";
SqlCommand com = new SqlCommand(checkuser, connection);
int temp = Convert.ToInt32(com.ExecuteScalar().ToString());
if (temp == 1)
{
Console.WriteLine("user already exists");
}
connection.Close();
}*/
}
protected void Button2_Click1(object sender, EventArgs e)
{
try
{
string cs =
ConfigurationManager.ConnectionStrings["employeeConnectionString"].ConnectionString;
SqlConnection conn = new SqlConnection(cs);
conn.Open();
string insertquery = "insert into
Users(Username,Password,Email,Cell,Location)values(@username,@password,@email,@cell,
@location)";
SqlCommand comm = new SqlCommand(insertquery, conn);
comm.Parameters.AddWithValue("@username", TextBox1.Text);
comm.Parameters.AddWithValue("@password", TextBox2.Text);
comm.Parameters.AddWithValue("@email", TextBox3.Text);
comm.Parameters.AddWithValue("@cell", TextBox4.Text);
comm.Parameters.AddWithValue("@Location", DropDownList1.SelectedValue);
comm.ExecuteNonQuery();
Response.Write("Registration Sucessful");
conn.Close();
}
catch (Exception ex)
{
Console.WriteLine("error:" + ex.ToString());
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("Login.aspx");
}
}
}
//login.aspx.cs
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;
namespace RegistrationUsers
{
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
HTML FILES:
//admin.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Admin.aspx.cs"
Inherits="RegistrationUsers.Admin" %>
Welcome
User Registration View All Users
//viewusers.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="view users.aspx.cs"
Inherits="RegistrationUsers.view_users" %>
ALL USERS
SelectChennaiHyderabadBanglorePuneDelhiVizag
//webform1.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs"
Inherits="RegistrationUsers.WebForm1" %>
Registration Form
Username
Password
Email
Cell
Location
SelectChennaiHyderabadBanglorePuneDelhiVizag
//login.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs"
Inherits="RegistrationUsers.Login" %>
Login
UsernamePassword
Solution
//program files
//admin.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace RegistrationUsers
{
public partial class Admin : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("WebForm1.aspx");
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("view users.aspx");
}
}
}
//view users.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace RegistrationUsers
{
public partial class view_users : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
//webform1.aspx.cs
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;
namespace RegistrationUsers
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
/* if (IsPostBack)
{
String cs = ConfigurationManager.ConnectionStrings["Data Source =
ADMINIB - 83V87D2; Initial Catalog = employee; Integrated Security = True; Connect
Timeout = 15; Encrypt = False; TrustServerCertificate = True; ApplicationIntent = ReadWrite;
MultiSubnetFailover = False"].ConnectionString;
SqlConnection connection = new SqlConnection(cs);
connection.Open();
string checkuser = "select count(*) from Users where Username=" +
TextBox1.Text + "'";
SqlCommand com = new SqlCommand(checkuser, connection);
int temp = Convert.ToInt32(com.ExecuteScalar().ToString());
if (temp == 1)
{
Console.WriteLine("user already exists");
}
connection.Close();
}*/
}
protected void Button2_Click1(object sender, EventArgs e)
{
try
{
string cs =
ConfigurationManager.ConnectionStrings["employeeConnectionString"].ConnectionString;
SqlConnection conn = new SqlConnection(cs);
conn.Open();
string insertquery = "insert into
Users(Username,Password,Email,Cell,Location)values(@username,@password,@email,@cell,
@location)";
SqlCommand comm = new SqlCommand(insertquery, conn);
comm.Parameters.AddWithValue("@username", TextBox1.Text);
comm.Parameters.AddWithValue("@password", TextBox2.Text);
comm.Parameters.AddWithValue("@email", TextBox3.Text);
comm.Parameters.AddWithValue("@cell", TextBox4.Text);
comm.Parameters.AddWithValue("@Location", DropDownList1.SelectedValue);
comm.ExecuteNonQuery();
Response.Write("Registration Sucessful");
conn.Close();
}
catch (Exception ex)
{
Console.WriteLine("error:" + ex.ToString());
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("Login.aspx");
}
}
}
//login.aspx.cs
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;
namespace RegistrationUsers
{
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
HTML FILES:
//admin.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Admin.aspx.cs"
Inherits="RegistrationUsers.Admin" %>
Welcome
User Registration View All Users
//viewusers.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="view users.aspx.cs"
Inherits="RegistrationUsers.view_users" %>
ALL USERS
SelectChennaiHyderabadBanglorePuneDelhiVizag
//webform1.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs"
Inherits="RegistrationUsers.WebForm1" %>
Registration Form
Username
Password
Email
Cell
Location
SelectChennaiHyderabadBanglorePuneDelhiVizag
//login.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs"
Inherits="RegistrationUsers.Login" %>
Login
UsernamePassword

More Related Content

Similar to program filesadmin.aspx.csusing System; using System.Colle.pdf

Integrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsIntegrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight Applications
Dan Wahlin
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1
Neeraj Mathur
 
ASP.NET MVC Controllers & Actions
ASP.NET MVC Controllers & ActionsASP.NET MVC Controllers & Actions
ASP.NET MVC Controllers & Actions
onsela
 
Programming web application
Programming web applicationProgramming web application
Programming web application
aspnet123
 

Similar to program filesadmin.aspx.csusing System; using System.Colle.pdf (20)

State management in asp
State management in aspState management in asp
State management in asp
 
Play framework
Play frameworkPlay framework
Play framework
 
Taming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, MacoscopeTaming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, Macoscope
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
 
Android Basic Components
Android Basic ComponentsAndroid Basic Components
Android Basic Components
 
DWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A TutorialDWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A Tutorial
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
 
Integrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsIntegrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight Applications
 
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXJava Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAX
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1
 
ASP.NET - Life cycle of asp
ASP.NET - Life cycle of aspASP.NET - Life cycle of asp
ASP.NET - Life cycle of asp
 
ASP.NET MVC Controllers & Actions
ASP.NET MVC Controllers & ActionsASP.NET MVC Controllers & Actions
ASP.NET MVC Controllers & Actions
 
Understanding Box UI Elements
Understanding Box UI ElementsUnderstanding Box UI Elements
Understanding Box UI Elements
 
Android Froyo
Android FroyoAndroid Froyo
Android Froyo
 
Asp.net life cycle
Asp.net life cycleAsp.net life cycle
Asp.net life cycle
 
Programming web application
Programming web applicationProgramming web application
Programming web application
 
Writing a massive javascript app
Writing a massive javascript appWriting a massive javascript app
Writing a massive javascript app
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
 
Asp.net By Durgesh Singh
Asp.net By Durgesh SinghAsp.net By Durgesh Singh
Asp.net By Durgesh Singh
 
03 page navigation and data binding in windows runtime apps
03   page navigation and data binding in windows runtime apps03   page navigation and data binding in windows runtime apps
03 page navigation and data binding in windows runtime apps
 

More from akshay1213

Vibrio cholerae is bacteria present in aquatic environment.It causes.pdf
Vibrio cholerae is bacteria present in aquatic environment.It causes.pdfVibrio cholerae is bacteria present in aquatic environment.It causes.pdf
Vibrio cholerae is bacteria present in aquatic environment.It causes.pdf
akshay1213
 
This theory of Hamilton of kin selection based on basic element the .pdf
This theory of Hamilton of kin selection based on basic element the .pdfThis theory of Hamilton of kin selection based on basic element the .pdf
This theory of Hamilton of kin selection based on basic element the .pdf
akshay1213
 
Thermoregulation is the ability of an organism to keep its body temp.pdf
Thermoregulation is the ability of an organism to keep its body temp.pdfThermoregulation is the ability of an organism to keep its body temp.pdf
Thermoregulation is the ability of an organism to keep its body temp.pdf
akshay1213
 
There are many reasons that web- based cameras to study animal behav.pdf
There are many reasons that web- based cameras to study animal behav.pdfThere are many reasons that web- based cameras to study animal behav.pdf
There are many reasons that web- based cameras to study animal behav.pdf
akshay1213
 
The java class Account that simultes the Account class.pdf
   The java class Account that simultes  the Account class.pdf   The java class Account that simultes  the Account class.pdf
The java class Account that simultes the Account class.pdf
akshay1213
 
Resonance structures are simply alternate Lewis s.pdf
                     Resonance structures are simply alternate Lewis s.pdf                     Resonance structures are simply alternate Lewis s.pdf
Resonance structures are simply alternate Lewis s.pdf
akshay1213
 

More from akshay1213 (20)

It is simple Using map object key as x and value as the calculation .pdf
It is simple Using map object key as x and value as the calculation .pdfIt is simple Using map object key as x and value as the calculation .pdf
It is simple Using map object key as x and value as the calculation .pdf
 
Vibrio cholerae is bacteria present in aquatic environment.It causes.pdf
Vibrio cholerae is bacteria present in aquatic environment.It causes.pdfVibrio cholerae is bacteria present in aquatic environment.It causes.pdf
Vibrio cholerae is bacteria present in aquatic environment.It causes.pdf
 
This theory of Hamilton of kin selection based on basic element the .pdf
This theory of Hamilton of kin selection based on basic element the .pdfThis theory of Hamilton of kin selection based on basic element the .pdf
This theory of Hamilton of kin selection based on basic element the .pdf
 
Thermoregulation is the ability of an organism to keep its body temp.pdf
Thermoregulation is the ability of an organism to keep its body temp.pdfThermoregulation is the ability of an organism to keep its body temp.pdf
Thermoregulation is the ability of an organism to keep its body temp.pdf
 
There are many reasons that web- based cameras to study animal behav.pdf
There are many reasons that web- based cameras to study animal behav.pdfThere are many reasons that web- based cameras to study animal behav.pdf
There are many reasons that web- based cameras to study animal behav.pdf
 
The following survival strategies were employed by the birds if thei.pdf
The following survival strategies were employed by the birds if thei.pdfThe following survival strategies were employed by the birds if thei.pdf
The following survival strategies were employed by the birds if thei.pdf
 
SavingsAccount.javapublic class SavingsAccount{             .pdf
SavingsAccount.javapublic class SavingsAccount{             .pdfSavingsAccount.javapublic class SavingsAccount{             .pdf
SavingsAccount.javapublic class SavingsAccount{             .pdf
 
The java class Account that simultes the Account class.pdf
   The java class Account that simultes  the Account class.pdf   The java class Account that simultes  the Account class.pdf
The java class Account that simultes the Account class.pdf
 
The number of protons in the nucleus of an elemen.pdf
                     The number of protons in the nucleus of an elemen.pdf                     The number of protons in the nucleus of an elemen.pdf
The number of protons in the nucleus of an elemen.pdf
 
Resonance structures are simply alternate Lewis s.pdf
                     Resonance structures are simply alternate Lewis s.pdf                     Resonance structures are simply alternate Lewis s.pdf
Resonance structures are simply alternate Lewis s.pdf
 
only above a certain temperature .pdf
                     only above a certain temperature                 .pdf                     only above a certain temperature                 .pdf
only above a certain temperature .pdf
 
molecular solids SO2, I2, P4, S8, H2O (ice) cov.pdf
                     molecular solids SO2, I2, P4, S8, H2O (ice)  cov.pdf                     molecular solids SO2, I2, P4, S8, H2O (ice)  cov.pdf
molecular solids SO2, I2, P4, S8, H2O (ice) cov.pdf
 
MnO4- because it is stronger oxidizing agent. .pdf
                     MnO4- because it is stronger oxidizing agent.    .pdf                     MnO4- because it is stronger oxidizing agent.    .pdf
MnO4- because it is stronger oxidizing agent. .pdf
 
Liquid decane because it is heavier and has great.pdf
                     Liquid decane because it is heavier and has great.pdf                     Liquid decane because it is heavier and has great.pdf
Liquid decane because it is heavier and has great.pdf
 
IV is a saturate hydrocarbon (without multiple ca.pdf
                     IV is a saturate hydrocarbon (without multiple ca.pdf                     IV is a saturate hydrocarbon (without multiple ca.pdf
IV is a saturate hydrocarbon (without multiple ca.pdf
 
in saturation ca2+ conc = OH- conc as 2 OH- will.pdf
                     in saturation ca2+ conc = OH- conc  as 2 OH- will.pdf                     in saturation ca2+ conc = OH- conc  as 2 OH- will.pdf
in saturation ca2+ conc = OH- conc as 2 OH- will.pdf
 
D ALL of them .pdf
                     D ALL of them                                    .pdf                     D ALL of them                                    .pdf
D ALL of them .pdf
 
C is best methode Bromination of alkane is most f.pdf
                     C is best methode Bromination of alkane is most f.pdf                     C is best methode Bromination of alkane is most f.pdf
C is best methode Bromination of alkane is most f.pdf
 
C. CH3Br note like dissolves like. All the othe.pdf
                     C. CH3Br  note like dissolves like. All the othe.pdf                     C. CH3Br  note like dissolves like. All the othe.pdf
C. CH3Br note like dissolves like. All the othe.pdf
 
P(white head) = 1115P(white tails) = 925P(head white.pdf
P(white  head) = 1115P(white  tails) = 925P(head  white.pdfP(white  head) = 1115P(white  tails) = 925P(head  white.pdf
P(white head) = 1115P(white tails) = 925P(head white.pdf
 

Recently uploaded

會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
中 央社
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
EADTU
 

Recently uploaded (20)

How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 

program filesadmin.aspx.csusing System; using System.Colle.pdf

  • 1. //program files //admin.aspx.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace RegistrationUsers { public partial class Admin : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("WebForm1.aspx"); } protected void Button2_Click(object sender, EventArgs e) { Response.Redirect("view users.aspx"); } } } //view users.aspx.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace RegistrationUsers { public partial class view_users : System.Web.UI.Page
  • 2. { protected void Page_Load(object sender, EventArgs e) { } } } //webform1.aspx.cs 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; namespace RegistrationUsers { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { /* if (IsPostBack) { String cs = ConfigurationManager.ConnectionStrings["Data Source = ADMINIB - 83V87D2; Initial Catalog = employee; Integrated Security = True; Connect Timeout = 15; Encrypt = False; TrustServerCertificate = True; ApplicationIntent = ReadWrite; MultiSubnetFailover = False"].ConnectionString; SqlConnection connection = new SqlConnection(cs); connection.Open(); string checkuser = "select count(*) from Users where Username=" + TextBox1.Text + "'"; SqlCommand com = new SqlCommand(checkuser, connection);
  • 3. int temp = Convert.ToInt32(com.ExecuteScalar().ToString()); if (temp == 1) { Console.WriteLine("user already exists"); } connection.Close(); }*/ } protected void Button2_Click1(object sender, EventArgs e) { try { string cs = ConfigurationManager.ConnectionStrings["employeeConnectionString"].ConnectionString; SqlConnection conn = new SqlConnection(cs); conn.Open(); string insertquery = "insert into Users(Username,Password,Email,Cell,Location)values(@username,@password,@email,@cell, @location)"; SqlCommand comm = new SqlCommand(insertquery, conn); comm.Parameters.AddWithValue("@username", TextBox1.Text); comm.Parameters.AddWithValue("@password", TextBox2.Text); comm.Parameters.AddWithValue("@email", TextBox3.Text); comm.Parameters.AddWithValue("@cell", TextBox4.Text); comm.Parameters.AddWithValue("@Location", DropDownList1.SelectedValue); comm.ExecuteNonQuery(); Response.Write("Registration Sucessful"); conn.Close(); } catch (Exception ex) {
  • 4. Console.WriteLine("error:" + ex.ToString()); } } protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("Login.aspx"); } } } //login.aspx.cs 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; namespace RegistrationUsers { public partial class Login : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } HTML FILES: //admin.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Admin.aspx.cs" Inherits="RegistrationUsers.Admin" %> Welcome
  • 5. User Registration View All Users //viewusers.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="view users.aspx.cs" Inherits="RegistrationUsers.view_users" %> ALL USERS SelectChennaiHyderabadBanglorePuneDelhiVizag //webform1.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="RegistrationUsers.WebForm1" %> Registration Form Username Password Email
  • 6. Cell Location SelectChennaiHyderabadBanglorePuneDelhiVizag //login.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="RegistrationUsers.Login" %> Login UsernamePassword Solution
  • 7. //program files //admin.aspx.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace RegistrationUsers { public partial class Admin : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("WebForm1.aspx"); } protected void Button2_Click(object sender, EventArgs e) { Response.Redirect("view users.aspx"); } } } //view users.aspx.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace RegistrationUsers { public partial class view_users : System.Web.UI.Page {
  • 8. protected void Page_Load(object sender, EventArgs e) { } } } //webform1.aspx.cs 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; namespace RegistrationUsers { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { /* if (IsPostBack) { String cs = ConfigurationManager.ConnectionStrings["Data Source = ADMINIB - 83V87D2; Initial Catalog = employee; Integrated Security = True; Connect Timeout = 15; Encrypt = False; TrustServerCertificate = True; ApplicationIntent = ReadWrite; MultiSubnetFailover = False"].ConnectionString; SqlConnection connection = new SqlConnection(cs); connection.Open(); string checkuser = "select count(*) from Users where Username=" + TextBox1.Text + "'"; SqlCommand com = new SqlCommand(checkuser, connection); int temp = Convert.ToInt32(com.ExecuteScalar().ToString());
  • 9. if (temp == 1) { Console.WriteLine("user already exists"); } connection.Close(); }*/ } protected void Button2_Click1(object sender, EventArgs e) { try { string cs = ConfigurationManager.ConnectionStrings["employeeConnectionString"].ConnectionString; SqlConnection conn = new SqlConnection(cs); conn.Open(); string insertquery = "insert into Users(Username,Password,Email,Cell,Location)values(@username,@password,@email,@cell, @location)"; SqlCommand comm = new SqlCommand(insertquery, conn); comm.Parameters.AddWithValue("@username", TextBox1.Text); comm.Parameters.AddWithValue("@password", TextBox2.Text); comm.Parameters.AddWithValue("@email", TextBox3.Text); comm.Parameters.AddWithValue("@cell", TextBox4.Text); comm.Parameters.AddWithValue("@Location", DropDownList1.SelectedValue); comm.ExecuteNonQuery(); Response.Write("Registration Sucessful"); conn.Close(); } catch (Exception ex) { Console.WriteLine("error:" + ex.ToString());
  • 10. } } protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("Login.aspx"); } } } //login.aspx.cs 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; namespace RegistrationUsers { public partial class Login : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } HTML FILES: //admin.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Admin.aspx.cs" Inherits="RegistrationUsers.Admin" %> Welcome
  • 11. User Registration View All Users //viewusers.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="view users.aspx.cs" Inherits="RegistrationUsers.view_users" %> ALL USERS SelectChennaiHyderabadBanglorePuneDelhiVizag //webform1.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="RegistrationUsers.WebForm1" %> Registration Form Username Password Email
  • 12. Cell Location SelectChennaiHyderabadBanglorePuneDelhiVizag //login.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="RegistrationUsers.Login" %> Login UsernamePassword