You are on page 1of 10

HOME PAGE 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;

public partial class INDEX System.Web.UI.Page ! protecte" #oi" Page$%oa"&ob'ect sen"er( E#ent)rgs e* ! + protecte" #oi" %in,-utton.$Clic,&ob'ect sen"er( E#ent)rgs e* ! Ser#er./ransfer&01uestioninsertion.asp20*; +

protecte" #oi" %in,-utton.$Clic,.&ob'ect sen"er( E#ent)rgs e* ! Ser#er./ransfer&01uestioninsertion.asp20*; + protecte" #oi" %in,-utton3$Clic,&ob'ect sen"er( E#ent)rgs e* ! Ser#er./ransfer&0up"ateform.asp20*; + protecte" #oi" %in,-utton4$Clic,&ob'ect sen"er( E#ent)rgs e* ! Ser#er./ransfer&0#ie51uestionslist.asp20*; + protecte" #oi" %in,-utton6$Clic,&ob'ect sen"er( E#ent)rgs e* ! Ser#er./ransfer&0stu"entfee"bac,form.asp20*; + protecte" #oi" %in,-utton7$Clic,&ob'ect sen"er( E#ent)rgs e* ! Ser#er./ransfer&0fee"bac,e#aluation.asp20*; + +

Sa#e t8is as 9INDEX.asp2.cs: INSERTING QUESTIONS using System; using System.Data; using System.Configuration; 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.;leDb; public partial class $Default System.Web.UI.Page ! protecte" #oi" Page$%oa"&ob'ect sen"er( E#ent)rgs e* ! + protecte" #oi" /e2t-o2.$/e2tC8ange"&ob'ect sen"er( E#ent)rgs e* ! + protecte" #oi" a""button$Clic,&ob'ect sen"er( E#ent)rgs e* ! if &1uestionte2tbo2./e2t.E1uals&00**

re1uire"fiel"./e2t < 0 =e1uire" fiel" is Empty0; else ! try ! ;leDbConnection conn; ;leDbComman" "c; int 1uestioni" < int.Parse&1uestioni"te2tbo2./e2t*; string 1uestion < 1uestionte2tbo2./e2t; conn < ne5 ;leDbConnection&0Pro#i"er<>SD);=)..;user i"<s#pcet;pass5or"<s#pcet;"ata source<pro'ects0*; conn.;pen&*; "c < ne5 ;leDbComman"&0insert into 1uestion"atabase #alues&0 ? 1uestioni" ? 0(@0 ? 1uestion ? 0@*0( conn*; "c.E2ecute=ea"er&*; conn.Close&*; resultlabel./e2t < 1uestioni" ? 0user create" successfully...0; + catc8 &E2ception e2ec* ! resultlabel./e2t < e2ec.>essage; + + + protecte" #oi" 1uestioni"te2tbo2$Init&ob'ect sen"er( E#ent)rgs e* !

;leDbConnection conn; ;leDbComman" "c; ;leDbData=ea"er "r; string connectionstring < &string*ConfigurationSettings.)ppSettingsA0ConnectionString0B; conn < ne5 ;leDbConnection&connectionstring*; conn.;pen&*; "c < ne5 ;leDbComman"&0select ma2&1uestioni"* from 1uestion"atabase 0( conn*; "r < "c.E2ecute=ea"er&*; "r.=ea"&*; int incrno < int.Parse &"r.CetDalue&E*./oString&**; incrno ??; 1uestioni"te2tbo2./e2t <incrno ./oString &*; "r.Close&*; conn.Close&*; + protecte" #oi" listof1uestionsbutton$Clic,&ob'ect sen"er( E#ent)rgs e* ! Ser#er./ransfer&0#ie51uestionslist.asp20*; + protecte" #oi" -utton.$Clic,&ob'ect sen"er( E#ent)rgs e* ! Ser#er./ransfer&0INDEX.asp20*; + + Sa#e t8is file as 91uestioninsertion.asp2.cs:

VIEW QUESTIONS 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.;leDb; public partial class #ie51uestionslist System.Web.UI.Page ! protecte" #oi" Page$%oa"&ob'ect sen"er( E#ent)rgs e* ! ;leDbConnection conn; ;leDbComman" "c; ;leDbData)"apter "a; string connectionstring < &string*ConfigurationSettings.)ppSettingsA0ConnectionString0B; conn < ne5 ;leDbConnection&connectionstring*; conn.;pen&*;

"c < ne5 ;leDbComman"&0SE%EC/ FUES/I;NID( FUES/I;N G=;> FUES/I;ND)/)-)SE0( conn*; "c.Comman"/ype < Comman"/ype./e2t; "a < ne5 ;leDbData)"apter&"c*; DataSet "s < ne5 DataSet&*; "a.Gill&"s*; "c.E2ecute=ea"er&*; DataCri"..DataSource < "s; DataCri"..Data-in"&*; conn.Close&*; + protecte" #oi" bac,button$Clic,&ob'ect sen"er( E#ent)rgs e* ! Ser#er./ransfer&01uestioninsertion.asp20*; + protecte" #oi" -utton.$Clic,&ob'ect sen"er( E#ent)rgs e* ! Ser#er./ransfer&0INDEX.asp20*; + + Sa#e t8is file as 9#ie51uestionlist.asp2.cs: UPDATE QUESTIONS 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.;leDb; public partial class up"ateform System.Web.UI.Page ! protecte" #oi" Page$%oa"&ob'ect sen"er( E#ent)rgs e* ! + protecte" #oi" 1uestioni"%ist$Init&ob'ect sen"er( E#ent)rgs e* ! 1uestioni"list.Items.Clear&*; ;leDbConnection conn; ;leDbComman" "c; ;leDbData=ea"er "r; string connectionstring<&string*ConfigurationSettings.)ppSettingsA0ConnectionString0B; conn < ne5 ;leDbConnection&connectionstring*; conn.;pen&*;

"c < ne5 ;leDbComman"&0select 1uestioni" from 1uestion"atabase0( conn*; "r < "c.E2ecute=ea"er&*; 58ile &"r.=ea"&** ! string username < "r.CetDalue&E*./oString&*; 1uestioni"list.Items.)""&username*; + "r.Close&*; conn.Close&*; + protecte" #oi" up"atebutton$Clic,&ob'ect sen"er( E#ent)rgs e* ! int 1uestioni"; if &1uestionte2tbo2./e2t.E1uals&00** re1uire"fiel"./e2t < 0 =e1uire" fiel" is Empty0; else ! try ! ;leDbConnection conn; ;leDbComman" "c; 1uestioni" < int.Parse&1uestioni"list./e2t*; string 1uestion < 1uestionte2tbo2./e2t; string connectionstring < &string*ConfigurationSettings.)ppSettingsA0ConnectionString0B; conn < ne5 ;leDbConnection&connectionstring*;

conn.;pen&*; "c < ne5 ;leDbComman"&0up"ate 1uestion"atabase set 1uestion<@0 ? 1uestion ? 0@ 58ere 1uestioni"<0 ? 1uestioni" ? 0 0( conn*; "c.E2ecute=ea"er&*; conn.Close&*; resultlabel./e2t < 1uestioni" ? 0 up"ate" successfully...0; + catc8 &E2ception e2ec* ! resultlabel./e2t < e2ec.>essage; + + + protecte" #oi" -utton.$Clic,&ob'ect sen"er( E#ent)rgs e* ! Ser#er./ransfer&0INDEX.asp20*; + + Sa#e t8is file as 9up"ateform.asp2.cs: