CATEGORY E PRACTICAL NO:1 SOURCE CODE
Public Class Prg1 Dim tries As Integer Private Sub Button1_Click(ByVal sender As System. b!ect" ByVal e As System.#ventArgs$ %andles Button1.Click I& 'e(tBo().'e(t * +admin+ ',en -essageBo(.S,o.(+/elcome" + 0 'e(tBo(1.'e(t$ #nd #lse tries * tries 1 1 I& tries * 2 ',en -essageBo(.S,o.(+3ou ,ave e(ceeded ma( number o& attem4ts555 ',e a44lication .ill close no.5+$ #nd #lse 'e(tBo().'e(t * ++ 'e(tBo().6ocus($ #nd I& #nd I& #nd Sub
OUTPUT:
PRACTICAL NO:2 SOURCE CODE
Public Class 4rg) Private Sub Button1_Click(ByVal sender As System. b!ect" ByVal e As System.#ventArgs$ %andles Button1.Click I& 7adioButton1.C,ecked * 'rue ',en Dim a" b As Integer Dim o4 As String a * Integer.Parse('e(tBo(1.'e(t$ b * Integer.Parse('e(tBo(8.'e(t$ o4 * 'e(tBo().'e(t Select Case o4 Case +9+ 'e(tBo(2.'e(t * a 9 b Case +1+ 'e(tBo(2.'e(t * a 1 b Case +:+ 'e(tBo(2.'e(t * a : b Case +;+ 'e(tBo(2.'e(t * a ; b Case #lse 'e(tBo(2.'e(t * ++ -essageBo(.S,o.(+Invalid o4eration....+$ #nd Select #lse Dim a" b As Single Dim o4 As String a * Single.Parse('e(tBo(1.'e(t$ b * Single.Parse('e(tBo(8.'e(t$ o4 * 'e(tBo().'e(t Select Case o4 Case +9+ 'e(tBo(2.'e(t * a 9 b Case +1+ 'e(tBo(2.'e(t * a 1 b Case +:+ 'e(tBo(2.'e(t * a : b Case +;+ 'e(tBo(2.'e(t * a ; b Case #lse 'e(tBo(2.'e(t * ++ -essageBo(.S,o.(+Invalid o4eration....+$ #nd Select #nd I& #nd Sub #nd Class
OUTPUT:
PRACTICAL NO:3 SOURCE CODE
Public Class 4rg8 Private Sub Button1_Click(ByVal sender As System. b!ect" ByVal e As System.#ventArgs$ %andles Button1.Click Dim a" b" c As Single a * Single.Parse('e(tBo(1.'e(t$ b * Single.Parse('e(tBo().'e(t$ c * Single.Parse('e(tBo(8.'e(t$ -essageBo(.S,o.(+',e interest .ill be + 0 Interest(a" b" c$$ #nd Sub Private 6unction Interest(ByVal 4 As Single" ByVal n As Single" ByVal r As Single$ As Single Dim intr As Single intr * 4 9 n 9 r ; 1<< 7eturn intr #nd 6unction Private Sub Button)_Click(ByVal sender As System. b!ect" ByVal e As System.#ventArgs$ %andles Button).Click Dim a" b" c As Single a * Single.Parse('e(tBo(1.'e(t$ b * Single.Parse('e(tBo().'e(t$ c * Single.Parse('e(tBo(8.'e(t$ -essageBo(.S,o.(+',e &inal amount is =+ 0 (a 1 Interest(a" b" c$$$ #nd Sub #nd Class
OUTPUT:
PRACTICAL NO:4 SOURCE CODE
Public Class Prg2 Dim ticket_rate As Single Private Sub Button1_Click(ByVal sender As System. b!ect" ByVal e As System.#ventArgs$ %andles Button1.Click Dim rate" &are As Single &are * < I& ComboBo(1.SelectedItem * +AC+ ',en rate * ticket_rate 1 >< #lse rate * ticket_rate #nd I& I& 'e(tBo(1.'e(t ?@ ++ ',en Dim a As Integer a * Integer.Parse('e(tBo().'e(t$ I& a ? > r a @ A< ',en &are * &are 1 rate ; ) #lse &are * &are 1 rate #nd I& #nd I& I& 'e(tBo(8.'e(t ?@ ++ ',en Dim a As Integer a * Integer.Parse('e(tBo(2.'e(t$ I& a ? > r a @ A< ',en &are * &are 1 rate ; ) #lse &are * &are 1 rate #nd I& #nd I& I& 'e(tBo(>.'e(t ?@ ++ ',en Dim a As Integer a * Integer.Parse('e(tBo(A.'e(t$ I& a ? > r a @ A< ',en &are * &are 1 rate ; ) #lse &are * &are 1 rate #nd I& #nd I& &are * &are 1 (&are 9 2 ; 1<<$ -essageBo(.S,o.(+'otal amount = + 0 &are$ #nd Sub Private Sub Prg2_Boad(ByVal sender As System. b!ect" ByVal e As System.#ventArgs$ %andles -yBase.Boad ticket_rate * )>< #nd Sub
OUTPUT:
CATEGORY F PRACTICAL NO:1 SOURCE CODE
Public Class 6ileSelector #vent 6ileSelected(ByVal sender As b!ect" ByVal e As #ventArgs$ Private _e(t" _de&dir" _&ile As String Public Pro4erty #(t($ As String Cet 7eturn _e(t #nd Cet Set(ByVal value As String$ _e(t * value 4en6ileDialog1.6ilter * +9.+ 0 _e(t 0 +D9.+ 0 _e(t #nd Set #nd Pro4erty Public Pro4erty De&Dir($ As String Cet 7eturn _de&dir #nd Cet Set(ByVal value As String$ _de&dir * value 4en6ileDialog1.InitialDirectory * _de&dir #nd Set #nd Pro4erty Public 7ead nly Pro4erty 6ile($ As String Cet 7eturn _&ile #nd Cet #nd Pro4erty Private Sub 6ileSelector_Boad(ByVal sender As System. b!ect" ByVal e As System.#ventArgs$ %andles -yBase.Boad _e(t * +t(t+ _de&dir * +,=Ekamlakar+ 4en6ileDialog1.6ilter * +9.+ 0 _e(t 0 +D9.+ 0 _e(t 4en6ileDialog1.InitialDirectory * _de&dir #nd Sub Private Sub Button1_Click(ByVal sender As System. b!ect" ByVal e As System.#ventArgs$ %andles Button1.Click I& 4en6ileDialog1.S,o.Dialog * Dialog7esult. F ',en 'e(tBo(1.'e(t * 4en6ileDialog1.6ileGame _&ile * 'e(tBo(1.'e(t 7aise#vent 6ileSelected(Got,ing" Got,ing$ #nd I& #nd Sub #nd Class
OUTPUT:
PRACTICAL NO:2 SOURCE CODE
Account.vb
Public Class Account Private _Accnum As Integer Private _accname As String Private _bal As Single Public S,ared acc As Integer Public Sub Ge.(ByVal name As String" ByVal o4enbal As Single$ _Accnum * acc 1 1 acc * acc 1 1 _accname * name _bal * o4enbal #nd Sub Public 6unction c,eckstatus($ As String 7eturn +Acc Go = + 0 _Accnum 0 +"+ 0 + Game= + 0 _accname 0 +"+ 0 +Cur Bal = + 0 _bal #nd 6unction Public 7ead nly Pro4erty accnum($ As Integer Cet 7eturn _Accnum #nd Cet #nd Pro4erty Public Pro4erty accname($ As String Cet 7eturn _accname #nd Cet Set(ByVal value As String$ I& value ?@ ++ ',en _accname * value #nd Set #nd Pro4erty Public Pro4erty currbal($ As Single Cet 7eturn _bal #nd Cet Set(ByVal value As Single$ I& value @ < ',en _bal * value #nd Set #nd Pro4erty
Pr 2.vb
-odule Prg) Sub -ain($ Dim a1 As Ge. Account(+-anali+" ><<<<$ Dim a) As Ge. Account(+Prat,mes,+" 8<<<<$ Dim a8 As Ge. Account(+Amruta+" 8<<<<$ Console./riteBine(a1.c,eckstatus$ Console./riteBine(a).c,eckstatus$ Console./riteBine(a8.c,eckstatus$ Console.7ead($ #nd Sub #nd -odule
OUTPUT:
PRACTICAL NO:3 SOURCE CODE
Im4orts System.Data.SHlClient Public Class 4rg2 Dim con As SHlConnection Dim cmd" cmd1" cmd) As SHlCommand Dim drs As SHlData7eader Private Sub 4rg2_Boad(ByVal sender As System. b!ect" ByVal e As System.#ventArgs$ %andles -yBase.Boad con * Ge. SHlConnection(+Data Source*% -#:C)>AA<1<6#IInitial Catalog*logIIntegrated Security*'rue+$ con. 4en($ cmd * Ge. SHlCommand(+select 9 &rom em4+" con$ drs * cmd.#(ecute7eader #nd Sub Private Sub btnne(t_Click(ByVal sender As System. b!ect" ByVal e As System.#ventArgs$ %andles btnne(t.Click 'ry Dim b As Boolean b * drs.7ead($ I& Got b ',en drs * cmd.#(ecute7eader drs.7ead($ #nd I& 'e(tBo(1.'e(t * drs.CetString(<$ 'e(tBo().'e(t * drs.CetString(1$ 'e(tBo(8.'e(t * drs.CetString()$ Catc, e( As #(ce4tion -essageBo(.S,o.(e(.'oString$ #nd 'ry #nd Sub Private Sub btnma(_Click(ByVal sender As System. b!ect" ByVal e As System.#ventArgs$ %andles btnma(.Click drs.Close($ cmd) * Ge. SHlCommand(+select ma((em4salary$ &rom em4+" con$ J cmd).Command'e(t * +select ma((salary$ &rom em4+ Dim i As Single i * cmd).#(ecuteScalar -essageBo(.S,o.(+-a( salary * + 0 i$ #nd Sub Private Sub btntotal_Click(ByVal sender As System. b!ect" ByVal e As System.#ventArgs$ %andles btntotal.Click drs.Close($ cmd1 * Ge. SHlCommand(+select count(9$ &rom em4+" con$ Jcmd1.Command'e(t * +select count(9$ &rom em4+ Dim i As Integer i * cmd1.#(ecuteScalar -essageBo(.S,o.(+'otal no o& em4loyees * + 0 i$ #nd Sub #nd Class
OUTPUT:
CATEGORY G PRACTICAL NO:1 SOURCE CODE
Partial Public Class 4rg1 In,erits System./eb.KI.Page Protected Sub Button1_Click(ByVal sender As b!ect" ByVal e As #ventArgs$ %andles Button1.Click Dim m1" y1" m)" y)" m8" y8" m2" y2 As Integer m1 * Integer.Parse('e(tBo().'e(t$ m) * Integer.Parse('e(tBo(2.'e(t$ m8 * Integer.Parse('e(tBo(A.'e(t$ m2 * Integer.Parse('e(tBo(L.'e(t$ y1 * Integer.Parse('e(tBo(8.'e(t$ y) * Integer.Parse('e(tBo(>.'e(t$ y8 * Integer.Parse('e(tBo(M.'e(t$ y2 * Integer.Parse('e(tBo(N.'e(t$ I& m1 @ A< And m) @ A< And (m8 1 m2$ ; ) @ >> And (y2 : y1$ * 2 ',en Babel1.'e(t * +3ou Huali&y...+ I& Dro4Do.nBist1.'e(t * +-umbai+ ',en Babel).'e(t * +Place o& Intervie. = V#S College" C,embur+ #lse Babel).'e(t * +Place o& Intervie. = Kniversity o& Pune+ #nd I& #lse Babel1.'e(t * +3ou dont Huali&y...+ #nd I& #nd Sub #nd Class
OUTPUT:
PRACTICAL NO:2 SOURCE CODE
Im4orts System./eb.Con&iguration Partial Public Class 4rg) In,erits System./eb.KI.Page Protected Sub Button1_Click(ByVal sender As b!ect" ByVal e As #ventArgs$ %andles Button1.Click Dim amt" rate" yr As Single yr * Integer.Parse(Dro4Do.nBist1.'e(t$ rate * Single.Parse(/ebCon&iguration-anager.A44Settings(Dro4Do.nBist1.'e(t$$ amt * Single.Parse('e(tBo(1.'e(t$ amt * amt 1 (amt ; 1<< 9 rate$ Babel1.'e(t * +7ate o& interest = + 0 rate 0 + 'otal Amount 4ayable = + 0 amt 0 + 0 3our mont,ly installment .ill be + 0 amt ; (yr 9 1)$ #nd Sub #nd Class
!"b.Con#$
?a44Settings@ ?add key*+>+ value*+>+;@ ?add key*+1<+ value*+L+;@ ?add key*+1>+ value*+1)+;@ ?;a44Settings@
OUTPUT:
PRACTICAL NO:3 SOURCE CODE
Public Partial Class 4rg8 In,erits System./eb.KI.Page Protected Sub 7adioButton1_C,eckedC,anged(ByVal sender As b!ect" ByVal e As #ventArgs$ %andles 7adioButton1.C,eckedC,anged Dro4Do.nBist1.Items.Clear($ Dro4Do.nBist1.Items.Add(+select A t,eatre+$ Dro4Do.nBist1.Items.Add(+CityCem+$ Dro4Do.nBist1.Items.Add(+CityStar+$ #nd Sub Protected Sub 7adioButton)_C,eckedC,anged(ByVal sender As b!ect" ByVal e As #ventArgs$ %andles 7adioButton).C,eckedC,anged Dro4Do.nBist1.Items.Clear($ Dro4Do.nBist1.Items.Add(+select A t,eatre+$ Dro4Do.nBist1.Items.Add(+CityCold+$ #nd Sub Protected Sub Dro4Do.nBist1_SelectedInde(C,anged(ByVal sender As b!ect" ByVal e As #ventArgs$ %andles Dro4Do.nBist1.SelectedInde(C,anged 'able1.Controls.Clear($ I& Dro4Do.nBist1.'e(t * +CityCem+ ',en Dim ro.1" ro.) As Ge. 'able7o.($ 'able1.Controls.Add(ro.1$ ro.1.Controls.Add(getcell(+S,o. 'imings+$$ ro.1.Controls.Add(getcell(+1)P-+$$ ro.1.Controls.Add(getcell(+8P-+$$ ro.1.Controls.Add(getcell(+AP-+$$ ro.1.Controls.Add(getcell(+NP-+$$ 'able1.Controls.Add(ro.)$ ro.).Controls.Add(getcell(+-ovie Game+$$ ro.).Controls.Add(getcell(+7aanb,ool+$$ ro.).Controls.Add(getcell(+Anandi Anand+$$ ro.).Controls.Add(getcell(+Badmas, Com4any+$$ ro.).Controls.Add(getcell(+Fites+$$ #lseI& Dro4Do.nBist1.'e(t * +CityStar+ ',en Dim ro.1" ro.) As Ge. 'able7o.($ 'able1.Controls.Add(ro.1$ ro.1.Controls.Add(getcell(+S,o. 'imings+$$ ro.1.Controls.Add(getcell(+1)P-+$$ ro.1.Controls.Add(getcell(+8P-+$$ ro.1.Controls.Add(getcell(+AP-+$$ ro.1.Controls.Add(getcell(+NP-+$$ 'able1.Controls.Add(ro.)$ ro.).Controls.Add(getcell(+-ovie Game+$$ ro.).Controls.Add(getcell(+7aanb,ool+$$ ro.).Controls.Add(getcell(+Anandi Anand+$$ ro.).Controls.Add(getcell(+Vi,ir+$$ ro.).Controls.Add(getcell(+Fites+$$
#lse Dim ro.1" ro.)" ro.8 As Ge. 'able7o.($ 'able1.Controls.Add(ro.1$ ro.1.Controls.Add(getcell(+S,o. 'imings+$$ ro.1.Controls.Add(getcell(+1)P-+$$ ro.1.Controls.Add(getcell(+8P-+$$ ro.1.Controls.Add(getcell(+AP-+$$ ro.1.Controls.Add(getcell(+NP-+$$ 'able1.Controls.Add(ro.)$ ro.).Controls.Add(getcell(+Screen1+$$ ro.).Controls.Add(getcell(+Avatar+$$ ro.).Controls.Add(getcell(+s,rek2+$$ ro.).Controls.Add(getcell(+S,rek2+$$ ro.).Controls.Add(getcell(+Fites+$$ 'able1.Controls.Add(ro.8$ ro.8.Controls.Add(getcell(+Screen)+$$ ro.8.Controls.Add(getcell(+Fites+$$ ro.8.Controls.Add(getcell(+Fites+$$ ro.8.Controls.Add(getcell(+Fites+$$ ro.8.Controls.Add(getcell(+Fites+$$ #nd I& #nd Sub Public 6unction getcell(ByVal te(t As String$ As 'ableCell Dim cell As Ge. 'ableCell($ cell.'e(t * te(t cell.Border/idt, * Knit.Pi(el(1$ cell.BorderStyle * BorderStyle.Inset 7eturn cell #nd 6unction #nd Class
OUTPUT:
PRACTICAL NO:4 SOURCE CODE
Pr 4%urv"&
Public Partial Class 4rg2survey In,erits System./eb.KI.Page Protected Sub Button1_Click(ByVal sender As b!ect" ByVal e As #ventArgs$ %andles Button1.Click Session(+username+$ * 'e(tBo(1.'e(t 7es4onse.7edirect(+Prg>s4orts.as4(+$ #nd Sub #nd Class
Pr 4%'ort%
Public Partial Class 4rg2s4orts In,erits System./eb.KI.Page Protected Sub Page_Boad(ByVal sender As b!ect" ByVal e As System.#ventArgs$ %andles -e.Boad I& -e.IsPostBack * 6alse ',en Dro4Do.nBist1.Items.Clear($ Dro4Do.nBist1.Items.Add(+Sac,in+$ Dro4Do.nBist1.Items.Add(+Anand+$ Dro4Do.nBist1.Items.Add(+Sania+$ #nd I& #nd Sub Protected Sub Button1_Click(ByVal sender As b!ect" ByVal e As #ventArgs$ %andles Button1.Click Session(+s4orts+$ * Dro4Do.nBist1.SelectedItem 7es4onse.7edirect(+Prg>-in.as4(+$ #nd Sub #nd Class
Pr 4($n
Public Partial Class 4rg2-in In,erits System./eb.KI.Page Protected Sub Page_Boad(ByVal sender As b!ect" ByVal e As System.#ventArgs$ %andles -e.Boad I& -e.IsPostBack * 6alse ',en Dro4Do.nBist1.Items.Clear($ Dro4Do.nBist1.Items.Add(+7a,ul gand,i+$ Dro4Do.nBist1.Items.Add(+C,indambaram+$ Dro4Do.nBist1.Items.Add(+-anmo,an sing,+$ #nd I& #nd Sub Protected Sub Button1_Click(ByVal sender As b!ect" ByVal e As #ventArgs$ %andles Button1.Click Session(+min+$ * Dro4Do.nBist1.SelectedItem 7es4onse.7edirect(+Prg>Bast.as4(+$ #nd Sub #nd Class
Pr 4L)%t
Public Partial Class 4rg2Bast In,erits System./eb.KI.Page Protected Sub Page_Boad(ByVal sender As b!ect" ByVal e As System.#ventArgs$ %andles -e.Boad 7es4onse./rite(+%ello + 0 Session(+username+$.'oString($$ 7es4onse./rite(+?br@ 3our selections are as &ollo.s = ?br@+$ 7es4onse./rite(+?br@ 6avorite s4orts4erson = + 0 Session(+s4orts+$.'oString($$ 7es4onse./rite(+?br@6avorite -inister = + 0 Session(+min+$.'oString($$ 7es4onse./rite(+?br@ t,ank you &or registering your vote...+$ #nd Sub #nd Class OUTPUT:
PRACTICAL NO:* SOURCE CODE
Public Partial Class 4rg> In,erits System./eb.KI.Page Protected Sub Dro4Do.nBist1_SelectedInde(C,anged(ByVal sender As b!ect" ByVal e As #ventArgs$ %andles Dro4Do.nBist1.SelectedInde(C,anged 'able1.Controls.Clear($ I& Dro4Do.nBist1.'e(t * +CityCem+ ',en Dim ro.1" ro.) As Ge. 'able7o.($ 'able1.Controls.Add(ro.1$ ro.1.Controls.Add(getcell(+S,o. 'imings+$$ ro.1.Controls.Add(getcell(+1)P-+$$ ro.1.Controls.Add(getcell(+8P-+$$ ro.1.Controls.Add(getcell(+AP-+$$ ro.1.Controls.Add(getcell(+NP-+$$ 'able1.Controls.Add(ro.)$ ro.).Controls.Add(getcell(+-ovie Game+$$ ro.).Controls.Add(getcell(+7aanb,ool+$$ ro.).Controls.Add(getcell(+Anandi Anand+$$ ro.).Controls.Add(getcell(+Badmas, Com4any+$$ ro.).Controls.Add(getcell(+Fites+$$ #lseI& Dro4Do.nBist1.'e(t * +CityStar+ ',en Dim ro.1" ro.) As Ge. 'able7o.($ 'able1.Controls.Add(ro.1$ ro.1.Controls.Add(getcell(+S,o. 'imings+$$ ro.1.Controls.Add(getcell(+1)P-+$$ ro.1.Controls.Add(getcell(+8P-+$$ ro.1.Controls.Add(getcell(+AP-+$$ ro.1.Controls.Add(getcell(+NP-+$$ 'able1.Controls.Add(ro.)$ ro.).Controls.Add(getcell(+-ovie Game+$$ ro.).Controls.Add(getcell(+7aanb,ool+$$ ro.).Controls.Add(getcell(+Anandi Anand+$$ ro.).Controls.Add(getcell(+Vi,ir+$$ ro.).Controls.Add(getcell(+Fites+$$ #lse Dim ro.1" ro.)" ro.8 As Ge. 'able7o.($ 'able1.Controls.Add(ro.1$ ro.1.Controls.Add(getcell(+S,o. 'imings+$$ ro.1.Controls.Add(getcell(+1)P-+$$ ro.1.Controls.Add(getcell(+8P-+$$ ro.1.Controls.Add(getcell(+AP-+$$ ro.1.Controls.Add(getcell(+NP-+$$ 'able1.Controls.Add(ro.)$ ro.).Controls.Add(getcell(+Screen1+$$ ro.).Controls.Add(getcell(+Avatar+$$ ro.).Controls.Add(getcell(+s,rek2+$$ ro.).Controls.Add(getcell(+S,rek2+$$ ro.).Controls.Add(getcell(+Fites+$$ 'able1.Controls.Add(ro.8$
ro.8.Controls.Add(getcell(+Screen)+$$ ro.8.Controls.Add(getcell(+Fites+$$ ro.8.Controls.Add(getcell(+Fites+$$ ro.8.Controls.Add(getcell(+Fites+$$ ro.8.Controls.Add(getcell(+Fites+$$ #nd I& #nd Sub Protected Sub 7adioButton)_C,eckedC,anged(ByVal sender As b!ect" ByVal e As #ventArgs$ %andles 7adioButton).C,eckedC,anged Dro4Do.nBist1.Items.Clear($ Dro4Do.nBist1.Items.Add(+select A t,eatre+$ Dro4Do.nBist1.Items.Add(+CityCem+$ Dro4Do.nBist1.Items.Add(+CityStar+$ #nd Sub Public 6unction getcell(ByVal te(t As String$ As 'ableCell Dim cell As Ge. 'ableCell($ cell.'e(t * te(t cell.Border/idt, * Knit.Pi(el(1$ cell.BorderStyle * BorderStyle.Inset 7eturn cell #nd 6unction Protected Sub 7adioButton1_C,eckedC,anged(ByVal sender As b!ect" ByVal e As #ventArgs$ %andles 7adioButton1.C,eckedC,anged Dro4Do.nBist1.Items.Clear($ Dro4Do.nBist1.Items.Add(+select A t,eatre+$ Dro4Do.nBist1.Items.Add(+CityCold+$ #nd Sub #nd Class
Pr *.+,?O(ml version*+1.<+ encoding*+ut&:L+ O@ ?Advertisements@ ?Ad@ ?ImageKrl@Sunset.!4g?;ImageKrl@ ?;Ad@ ?Ad@ ?ImageKrl@/ater lilies.!4g?;ImageKrl@ ?;Ad@ ?Ad@ ?ImageKrl@/inter.!4g?;ImageKrl@ ?;Ad@ ?;Advertisements@
OUTPUT:
C)t" or& .
PRACTICAL NO:1 SOURCE CODE
Pr)c1.)%'+
Im4orts System.Data.SHlClient Partial Public Class Prac1 In,erits System./eb.KI.Page Dim con As Ge. SHlConnection Dim cmd" cmd1 As Ge. SHlCommand Dim drs" dr As SHlData7eader Protected Sub Button1_Click(ByVal sender As b!ect" ByVal e As #ventArgs$ %andles Button1.Click con * Ge. SHlConnection(+Data Source*C -P1NIInitial Catalog*estateIIntegrated Security*'rue+$ con. 4en($ cmd * Ge. SHlCommand(+select 9 &rom Customer .,ere AccountGo*J+ 1 'e(tBo(1.'e(t 1 +J and Pass.ord*J+ 1 'e(tBo().'e(t 1 +J+" con$ drs * cmd.#(ecute7eader($ I& drs.7ead($ ',en Babel8.'e(t * +Bogin Success&ul + 0 +3our Current Balance is + 0 drs.CetString(8$ cmd1 * Ge. SHlCommand(+select 9 &rom 'rans .,ere AccountGo*J+ 1 'e(tBo(1.'e(t 1 +J+" con$ drs.Close($ dr * cmd1.#(ecute7eader($ /,ile dr.7ead($ Babel2.'e(t * +3our 'ranscation Id is= + 0 dr.CetString(<$ 0 +3our Account Go is= + 0 dr.CetString(1$ 0 + 3our 'rans Date is= + 0 dr.CetValue()$ 0 + 3our Amount is= + 0 dr.CetString(8$ 0 + 3our 'y4e is= + 0 dr.CetString(2$ #nd /,ile #lse Babel8.'e(t * +Bogin 6ailed+ #nd I& #nd Sub #nd Class
K'PK'=
PRACTICAL NO:2
SOURCE CODE
Pr)c2.)%'+
Im4orts System.Data.SHlClient Partial Public Class _De&ault In,erits System./eb.KI.Page Dim con As Ge. SHlConnection Dim cmd As Ge. SHlCommand Dim da As Ge. SHlDataAda4ter Dim ds As Ge. DataSet Protected Sub Dro4Do.nBist1_SelectedInde(C,anged(ByVal sender As b!ect" ByVal e As #ventArgs$ %andles Dro4Do.nBist1.SelectedInde(C,anged con * Ge. SHlConnection(+Data Source*C -P1NIInitial Catalog*estateIIntegrated Security*'rue+$ con. 4en($ da * Ge. SHlDataAda4ter(+select 9 &rom 6lat .,ere CityId*J+ 1 Dro4Do.nBist1.'e(t 1 +J+" con$ da.6ill(ds" +6lat+$ CridVie.1.DataSource * ds CridVie.1.DataBind($ #nd Sub #nd Class
K'PK'=
PRACTICAL NO:3
SOURCE CODE
Pr)c3.)%'+
Im4orts System.Pml Partial Public Class Prac8 In,erits System./eb.KI.Page Protected Sub Button1_Click(ByVal sender As b!ect" ByVal e As #ventArgs$ %andles Button1.Click Dim doc As PmlDocument doc * Ge. PmlDocument($ doc.Boad(+D=Es.a4nitaEvbECategory%ECategory%EPrac8.(ml+$ 6or #ac, element As Pml#lement In doc.Document#lement.C,ildGodes Dim c,annel As String c,annel * element.CetAttribute(+name+$ I& element.C,ildGodes(<$.Inner'e(t * Dro4Do.nBist1.'e(t And element.C,ildGodes(1$.Inner'e(t * Dro4Do.nBist).'e(t ',en Babel8.'e(t * c,annel #nd I& Ge(t #nd Sub #nd Class
Pr 3.+,?O(ml version*+1.<+ encoding*+ut&:L+ O@ ?Cable'V@ ?c,annel name*+Aa! 'ak+@ ?language@%indi?;language@ [email protected]?;category@ ?;c,annel@ ?c,annel name*+Star -ovies+@ ?language@#nglis,?;language@ ?category@-ovies?;category@ ?;c,annel@ ?c,annel name*+Qee -arat,i+@ ?language@-arat,i?;language@ ?category@#ntertainment?;category@ ?;c,annel@ ?c,annel name*+Colors+@ ?language@%indi?;language@ ?category@#ntertainment?;category@ ?;c,annel@ ?c,annel name*+Qee 'v+@ ?language@%indi?;language@ ?category@#ntertainment?;category@ ?;c,annel@
?c,annel name*+Cartoon Get.ork+@
?language@#nglis,?;language@ ?category@#ntertainment?;category@ ?;c,annel@ ?c,annel name*+Geo S4orts+@ ?language@#nglis,?;language@ ?category@S4orts?;category@ ?;c,annel@ ?;Cable'V@
OUTPUT:
PRACTICAL NO:4
SOURCE CODE
Pr)c4.)%'+
Public Partial Class 4rac2 In,erits System./eb.KI.Page Protected Sub BinkButton1_Click(ByVal sender As b!ect" ByVal e As #ventArgs$ %andles BinkButton1.Click Session(+test+$ * Dro4Do.nBist1.'e(t 7es4onse.7edirect(+Prac21.as4(+$ #nd Sub #nd Class
Pr)c41.)%'+
Public Partial Class Prac21 In,erits System./eb.KI.Page Protected Sub Page_Boad(ByVal sender As b!ect" ByVal e As System.#ventArgs$ %andles -e.Boad Dim test As String test * C'y4e(Session(+test+$" String$ I& test * +Central PlaRa+ ',en I& Cac,e(+Central PlaRa+$ Is Got,ing ',en Dim 'able As String 'able * +?table border*1@+ 'able 0* +?tr@+ 'able 0* +?t,@ S,o. 'iming?;t,@+ 'able 0* +?td@1)4m?;td@+ 'able 0* +?td@84m?;td@+ 'able 0* +?td@A4m?;td@+ 'able 0* +?;tr@+ 'able 0* +?tr@+ 'able 0* +?t,@ Game & ',e -ovies?;t,@+ 'able 0* +?td@Bodyguard?;td@+ 'able 0* +?td@'.illig,t?;td@+ 'able 0* +?td@C,ost?;td@+ 'able 0* +?;tr@+ 'able 0* +?;table@+ Babel1.'e(t * 'able Cac,e.Insert(+Central PlaRa+" 'able$ #lse 7es4onse./rite(+7etriving value &rom Cac,e+$ Babel1.'e(t * C'y4e(Cac,e(+Central PlaRa+$" String$ #nd I& #lseI& test * +7o(y+ ',en I& Cac,e(+7o(y+$ Is Got,ing ',en Dim 'able As String 'able * +?table border*1@+ 'able 0* +?tr@+ 'able 0* +?t,@ S,o. 'iming?;t,@+ 'able 0* +?td@24m?;td@+ 'able 0* +?td@M4m?;td@+ 'able 0* +?td@1<4m?;td@+ 'able 0* +?;tr@+
'able 0* +?tr@+ 'able 0* +?t,@ Game & ',e -ovies?;t,@+ 'able 0* +?td@Agnee4at,?;td@+ 'able 0* +?td@-ission Im4ossible 2?;td@+ 'able 0* +?td@Avatar?;td@+ 'able 0* +?;tr@+ 'able 0* +?;table@+ Babel1.'e(t * 'able Cac,e.Insert(+7o(y+" 'able$ #lse 7es4onse./rite(+7etriving value &rom Cac,e+$ Babel1.'e(t * C'y4e(Cac,e(+7o(y+$" String$ #nd I& #lseI& test * +Ge. #m4ire+ ',en I& Cac,e(+Ge. #m4ire+$ Is Got,ing ',en Dim 'able As String 'able * +?table border*1@+ 'able 0* +?tr@+ 'able 0* +?t,@ S,o. 'iming?;t,@+ 'able 0* +?td@84m?;td@+ 'able 0* +?td@A4m?;td@+ 'able 0* +?td@N4m?;td@+ 'able 0* +?;tr@+ 'able 0* +?tr@+ 'able 0* +?t,@ Game & ',e -ovies?;t,@+ 'able 0* +?td@/ake u4 Sid?;td@+ 'able 0* +?td@7ang De Bansanti?;td@+ 'able 0* +?td@Dil C,a,ta ,ai?;td@+ 'able 0* +?;tr@+ 'able 0* +?;table@+ Babel1.'e(t * 'able Cac,e.Insert(+Ge. #m4ire+" 'able$ #lse 7es4onse./rite(+7etriving value &rom Cac,e+$ Babel1.'e(t * C'y4e(Cac,e(+Ge. #m4ire+$" String$ #nd I& #nd I& #nd Sub #nd Class
OUTPUT:
PRACTICAL NO:* SOURCE CODE
Pr)c*.)%'+
Im4orts System.Data.SHlClient Partial Public Class Prac> In,erits System./eb.KI.Page Dim con As Ge. SHlConnection Dim cmd As Ge. SHlCommand Dim dr As SHlData7eader Dim i As String Protected Sub 'imer1_'ick(ByVal sender As b!ect" ByVal e As #ventArgs$ %andles 'imer1.'ick con * Ge. SHlConnection(+Data Source*C -P1NIInitial Catalog*estateIIntegrated Security*'rue+$ con. 4en($ cmd * Ge. SHlCommand(+select ma((-atc,Id$ &rom -atc,+" con$ i * cmd.#(ecuteScalar($ cmd * Ge. SHlCommand(+select Score &rom -atc, .,ere -atc,Id*J+ 1 i 1 +J+" con$ dr * cmd.#(ecute7eader($ /,ile dr.7ead($ Babel1.'e(t * dr(<$ #nd /,ile #nd Sub #nd Class
Pr *.)%'+ D"%$ n
OUTPUT:
PRACTICAL NO:/ SOURCE CODE
!"b S"rv$c"% Stoc0.vb
Im4orts System./eb Im4orts System./eb.Services Im4orts System./eb.Services.Protocols Im4orts System.Data.SHlClient ;; built in coding J 'o allo. t,is /eb Service to be called &rom scri4t" using ASP.G#' ASAP" uncomment t,e &ollo.ing line. J ?System./eb.Scri4t.Services.Scri4tService($@ _ ?/ebService(Games4ace=*+,tt4=;;tem4uri.org;+$@ _ ?/ebServiceBinding(Con&orms'o=*/siPro&iles.BasicPro&ile1_1$@ _ ?Clobal.-icroso&t.VisualBasic.Com4ilerServices.DesignerCenerated($@ _ ;;code Public Class Stock In,erits System./eb.Services./ebService Dim con As Ge. SHlConnection Dim cmd As Ge. SHlCommand Dim no As String ?/eb-et,od($@ _ Public 6unction Gse($ As String con * Ge. SHlConnection(+Data Source*C -P1NIInitial Catalog*estateIIntegrated Security*'rue+$ con. 4en($ cmd * Ge. SHlCommand(+select GS# &rom Stock+" con$ no * cmd.#(ecuteScalar($ 7eturn no #nd 6unction ?/eb-et,od($@ _ Public 6unction Bse($ As String con * Ge. SHlConnection(+Data Source*C -P1NIInitial Catalog*estateIIntegrated Security*'rue+$ con. 4en($ cmd * Ge. SHlCommand(+select BS# &rom Stock+" con$ no * cmd.#(ecuteScalar($ 7eturn no #nd 6unction ?/eb-et,od($@ _ Public 6unction Cold($ As String con * Ge. SHlConnection(+Data Source*C -P1NIInitial Catalog*estateIIntegrated Security*'rue+$ con. 4en($ cmd * Ge. SHlCommand(+select Cold7ate &rom Stock+" con$ no * cmd.#(ecuteScalar($ 7eturn no #nd 6unction #nd Class
!"b%"rv$c".)%'+
Partial Class .ebservice In,erits System./eb.KI.Page Protected Sub Page_Boad(ByVal sender As b!ect" ByVal e As System.#ventArgs$ %andles -e.Boad Dim n As Ge. Stock Babel).'e(t * n.Gse($ Dim b As Ge. Stock Babel2.'e(t * b.Bse($ Dim g As Ge. Stock BabelA.'e(t * g.Cold($ #nd Sub #nd Class
OUTPUT:
PRACTICAL NO:2* SOURCE CODE
11Pro r), co2" #or ."-'"r c-)%% 3oo0E+c"'t$on.4)v) 4ackage cart.utilI 4ublic class Book#(ce4tion e(tends #(ce4tionT 4ublic Book#(ce4tion(String msg$ T System.out.4rintln(msg$I U U I25"r$#$"r.4)v) 4ackage cart.utilI 4ublic class IdVeri&ier T ;99 Creates a ne. instance o& IdVeri&ier 9; 4ublic IdVeri&ier($ T U 4ublic boolean validate(String id$ T boolean result*trueI &or(int i*<I i?id.lengt,($I i11$ T i&(C,aracter.isDigit(id.c,arAt(i$$**&alse$ T result*&alseI U U return resultI U U
11Cr")t$n r",ot" $nt"r#)c" C)rt.4)v) 4ackage cart.e!bI
im4ort cart.util.Book#(ce4tionI im4ort !ava.util.BistI im4ort !ava(.e!b.7emoteI V7emote 4ublic inter&ace Cart T 4ublic void initialiRe(String 4erson$ t,ro.s Book#(ce4tionI 4ublic void initialiRe( String 4erson" String id$ t,ro.s Book#(ce4tionI 4ublic void addBook(String title$I 4ublic void removeBook(String title$ t,ro.s Book#(ce4tionI 4ublic Bist?String@ getContents($I U
11Cr")t$n 3")n c-)%% C)rt3")n.4)v)
4ackage cart.e!bI im4ort cart.util.Book#(ce4tionI im4ort cart.util.IdVeri&ierI im4ort !ava.util.ArrayBistI im4ort !ava.util.BistI im4ort !ava(.e!b.7emoveI im4ort !ava(.e!b.State&ulI VState&ul($ 4ublic class CartBean im4lements Cart T Bist?String@ contentsI String customerIdI String customerGameI 4ublic void initialiRe(String 4erson$ t,ro.s Book#(ce4tion T i& (4erson ** null$ T t,ro. ne. Book#(ce4tion(+Gull 4erson not allo.ed.+$I U else T customerGame * 4ersonI U customerId * +<+I contents * ne. ArrayBist?String@($I U
4ublic void initialiRe( String 4erson" String id$ t,ro.s Book#(ce4tion T i& (4erson ** null$ T t,ro. ne. Book#(ce4tion(+Gull 4erson not allo.ed.+$I U else T customerGame * 4ersonI U IdVeri&ier idC,ecker * ne. IdVeri&ier($I i& (idC,ecker.validate(id$$ T customerId * idI U else T t,ro. ne. Book#(ce4tion(+Invalid id= + 1 id$I U contents * ne. ArrayBist?String@($I U 4ublic void addBook(String title$ T contents.add(title$I U 4ublic void removeBook(String title$ t,ro.s Book#(ce4tion T boolean result * contents.remove(title$I i& (result ** &alse$ T t,ro. ne. Book#(ce4tion(+E++ 1 title 1 +E+ not in cart.+$I U U 4ublic Bist?String@ getContents($ T return contentsI U U
11Cr")t$n !"b A''-$c)t$on In2"+.4%' ?WV4age im4ort*+cart.e!b.Cart" !ava.mat,.9"!ava(.naming.9"!ava.util.Iterator"!ava.util.Bist"cart.util.Book#(ce4tion+W@ ?W:: ',e taglib directive belo. im4orts t,e SS'B library. I& you uncomment it" you must also add t,e SS'B library to t,e 4ro!ect. ',e Add Bibrary... action on Bibraries node in Pro!ects vie. can be used to add t,e SS'B 1.1 library. ::W@ ?W:: ?WVtaglib uri*+,tt4=;;!ava.sun.com;!s4;!stl;core+ 4re&i(*+c+W@ ::W@ ?5D C'3P# %'-B PKBBIC +:;;/8C;;D'D %'-B 2.<1 'ransitional;;#G+ +,tt4=;;.....8.org;'7;,tml2;loose.dtd+@ ?W5 4rivate Cart cart * nullI 4ublic void !s4Init($ T try T InitialConte(t ic * ne. InitialConte(t($I cart * (Cart$ ic.looku4(Cart.class.getGame($$I U catc, (#(ce4tion e($ T System.out.4rintln(+CouldnJt create converter bean.+1 e(.get-essage($$I U U 4ublic void !s4Destroy($ T cart * nullI U W@ ?W try T cart.initialiRe(+SGB+" +1)8+$I cart.addBook(+Com4iler Design+$I cart.addBook(+Data Structure+$I cart.addBook(+ 4erating System+$I cart.addBook(+Get.orking+$I Bist?String@ bookBist"booklist1I bookBist * cart.getContents($I Iterator?String@ iterator * bookBist.iterator($I out.4rintln(+7etrieving book title &rom cart=+1+?br;@+$I .,ile (iterator.,asGe(t($$ T String title * iterator.ne(t($I out.4rintln(title1+?br;@+$I U out.4rintln(+?br;@+1+7emoving E+Get.orkingE+ &rom cart.+1+?br;@+1+?br;@+$I cart.removeBook(+Get.orking+$I
booklist1*cart.getContents($I Iterator?String@ iterator1 * booklist1.iterator($I out.4rintln(+7etrieving book title &rom cart=+1+?br;@+$I .,ile (iterator1.,asGe(t($$ T String title1 * iterator1.ne(t($I out.4rintln(title11+?br;@+$I U U catc, (Book#(ce4tion e($ T System.err.4rintln(+Caug,t a Book#(ce4tion= + 1 e(.get-essage($$I U catc, (#(ce4tion e($ T System.err.4rintln(+Caug,t an une(4ected e(ce4tion5+$I e(.4rintStack'race($I U W@
OUTPUT:
PRACTICAL NO:24 SOURCE CODE
11Cr")t$n r",ot" $nt"r#)c" Conv"rt"r.4)v)
4ackage converter.e!bI im4ort !ava.mat,.BigDecimalI im4ort !ava(.e!b.7emoteI V7emote 4ublic inter&ace Converter T 4ublic BigDecimal dollar'o3en(BigDecimal dollars$I 4ublic BigDecimal yen'o#uro(BigDecimal yen$I U
11Cr")t$n 3")n c-)%% Conv"rt"r3")n.4)v)
4ackage converter.e!bI im4ort !ava.mat,.BigDecimalI im4ort !ava(.e!b.StatelessI VStateless 4ublic class ConverterBean im4lements converter.e!b.Converter T 4rivate BigDecimal euro7ate * ne. BigDecimal(+<.<<M<+$I 4rivate BigDecimal yen7ate * ne. BigDecimal(+11).>L+$I 4ublic BigDecimal dollar'o3en(BigDecimal dollars$ T BigDecimal result * dollars.multi4ly(yen7ate$I return result.setScale()" BigDecimal.7 KGD_KP$I U 4ublic BigDecimal yen'o#uro(BigDecimal yen$ T BigDecimal result * yen.multi4ly(euro7ate$I return result.setScale()" BigDecimal.7 KGD_KP$I U U
11Cr")t$n !"b A''-$c)t$on In2"+.4%'
?WV4age content'y4e*+te(t;,tml+W@ ?WV4age 4age#ncoding*+K'6:L+W@ ?W:: ',e taglib directive belo. im4orts t,e SS'B library. I& you uncomment it" you must also add t,e SS'B library to t,e 4ro!ect. ',e Add Bibrary... action on Bibraries node in Pro!ects vie. can be used to add t,e SS'B 1.1 library. ::W@ ?W:: ?WVtaglib uri*+,tt4=;;!ava.sun.com;!s4;!stl;core+ 4re&i(*+c+W@ ::W@ ?5D C'3P# %'-B PKBBIC +:;;/8C;;D'D %'-B 2.<1 'ransitional;;#G+ +,tt4=;;.....8.org;'7;,tml2;loose.dtd+@ ?WV 4age im4ort*+converter.e!b.Converter" !ava.mat,.9" !ava(.naming.9+W@ ?W5 4rivate Converter converter * nullI 4ublic void !s4Init($ T try T InitialConte(t ic * ne. InitialConte(t($I converter * (Converter$ ic.looku4(Converter.class.getGame($$I U catc, (#(ce4tion e($ T System.out.4rintln(+CouldnJt create converter bean.+1 e(.get-essage($$I U U 4ublic void !s4Destroy($ T converter * nullI U W@ ?,tml@ ?,ead@ ?title@Converter?;title@ ?;,ead@ ?body bgcolor*+.,ite+@ ?,1@Converter?;,1@ ?,r@ ?4@#nter an amount to convert=?;4@ ?&orm met,od*+get+@ ?in4ut ty4e*+te(t+ name*+amount+ siRe*+)>+@ ?br@ ?4@ ?in4ut ty4e*+submit+ value*+Submit+@ ?in4ut ty4e*+reset+ value*+7eset+@ ?;&orm@ ?W String amount * reHuest.getParameter(+amount+$I i& ( amount 5* null 00 amount.lengt,($ @ < $ T BigDecimal d * ne. BigDecimal(amount$I
BigDecimal yenAmount * converter.dollar'o3en(d$I W@ ?4@ ?W* amount W@ dollars are ?W* yenAmount W@ 3en. ?4@ ?W BigDecimal euroAmount * converter.yen'o#uro(yenAmount$I W@ ?W* yenAmount W@ 3en are ?W* euroAmount W@ #uro. ?W U W@ ?;body@ ?;,tml@