0% found this document useful (0 votes)
212 views125 pages

Part 2 PDF

Uploaded by

varun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
212 views125 pages

Part 2 PDF

Uploaded by

varun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 125
8 Hole af twfimented_tn the 1 style , use con cal the . ome -— Method wing obj ef the clig. where ax if Jonplimentet “in 2 cfpfe we need fo call fhe method 6 = ng aicferenee of: the Interface oe ates ne - face Fnlerfacetcs end = ies — interface Interface 4 : | f ~ - a os 7 — — a ~ } a 0 _— - —_ \ nw - void Showy _ 3 FO — Ba _ _ fad @_ayother_ntey ace 265 i, - _ _ infer face — prblicl vord Tes _ ea las “ rele atte + _____void_ Interface 2. shout _ oe F on ae ay — Conwfectuniteline U Znferface 2o-shoo method) 3 shel viel Hah a yy Tmphedam c= new Tmphedaw (ly = __EnterFare aol test; dt. shower, xpshooey - —__§ Conse -Readline O15 _ yf freee peer pet eaten = a i Sfructwies 2 — dl le abo a auer-ceftnecdt Whe | seme wa class ewhich can cantain ever ee member a cass con contain fike Variehtes a methods. Comtructors OF ¢- - = 4 _gemedrfieme} Shucd SNeme> _ ele “ efuckure ee 2b Achun fs 0 ereference 1- Shyeune fe a _ | tyke. Uatse spe - em Alkocation, ts perforation 2- Hew pore lL “Hanged Heap mswo so $t has Ga Stacks vil dead \ = __autonehit mehary Managenyuts previde audeme tie neinor my oo “ae _ Sa but Fegfer 0 j accep chuck aio? 16, ee - 2 Requires Haw obet for object treahion: 1 (on Conein Variable cleclavation 's andl Mune voriabhay con be at ivikitteed al the time of rn declavedtion. ae “= 5 Azewargu:Conypuctr pe opfimel fora clay fo LS create Os object, whet r __ HLenegedves Is only 4 - Cong hbuctoy which con be efthes zo ayguencnt Or chefaald + © eo _ G+ Of defind oith O Cony _ offer Compidahar woe viel = - ee ie —_ wil finel 1 cons~ a © fe Sapp ts beth implinenialion co cme Interface Tnhevikemce. “Theje cove tuseal hive r OF baker, Come uncler reference o Hihe Cobepery tdere * ete wueprescn ty Hage volume 4 Can toofarn Verreble deder, tout thone vents can be __Nwittizcel ities vider & Conshuctey ov sign vole | srefeveng fo thever. th 5- A eo arg Conshy Meuictafory for o hex ob}. is ea feof nud Feywwoik Ao waphiert sac Here. With can maf 4 LP er compro ol f deAind wel ond Tink nt! Cons» Cem italian Is q impel fe fetetd Cor » Goppots Cr Inher tence Shuetuze con be from an yndedo-« S TAYE ane te» Represeny Vtlome 0; Ca wre: "ate g es rally Tmnpeivurded Tapes a chert Cele sys. eer ETA SO PN 8 = Because This is a! fe Ex. Stag , object &- Int, Fdoat etre ‘ —— — Ad a_tonde Fikes te progec? Naming it 98 Hytpactses “wheve @ tode file psa blank CH file In whith a oe cann_lefine any Wife Ake chats, Inkerface “ofucture ete: Wonte the follouma : : "a 33 nid 5 i _ hice Ooh Pregeet ‘ = ese tees ey | | “Shuck | My sfrect = _ | \ Ny Shut mt 5 TA Trvekeg Zero p oagtnient Coughucter [Be ee = Sensuming a shuclure-_ Shus olean't guppot Inheritance , = wh Lis possible to _comsawe Hie Abuctane _— either fom 9 Mee B/obuche by creating (sob g _ . Te test this_odel_anether_tede file mystucl 9-8 Ane uwortle the Feltowirg— rn _ uaing § ~ = resp. oma _ — .t = Fa _Shuet Mysbued 2 “ : _ et —| pesecn — Static void Hain U 3 -— — Po __Nistwet m= neo Myshuct (300); — Pe ee . om Dit ploy OO; . Console Reacltine Cay - z 7 —rrols. Revel White oleveloping on app. deme times Code mej — be weitten Under nmye thon one prozect alo where collectin of proseets th Kmen ai q 4odudion. * Whenever we created neo preted by default vs wilt create a solution ancl under it tre progect _ gets created, where 2olution Js colfection of progeds _ _ancl_puogect 15 coltection of rtems~ a _ _ Sobukion i = —_ ee i _ —* Gobection of Paez — “ss ws 2 Collection of items _ a _ A olution _odso o1eg res _@ tome which can a ay ________shecified by ua chide crvadiinn the pozect: or ele i} tail dake the name of fiat prgeet thet >, — Createcl (inder we avdudton, if not shect fied _ Thowt case solution name is oops pwzet becau _ our preect mame (s_oopsfrezects en 7 A solution con have pio peck: oy clifferenf Net Long's - me | as well as of cliff pinzect templates alse be wineows, console ede, bol a progect con nof contain — items of clit net kang They must de Apecific to Ge Language Cady: —___ a = (Te add news proyect under Ow eopsPuef solid night abc on oledim stocle tm dodulren explora and _sebiet add new aozect _bohich pons “New preget — _uvidows dea that seleet dors aa Viawel Cet = template os “Consel axpp" , reanve the pan zect an p29 and then chick ok cahich gata the pryee! Uneler po fifine > By defauth the neo project alo comes cath @ _ Clay pro are ander the namespace Acc nel prosect, _ Werte the following code In HS main methods —_ _Gonsofe ugite line C'Sreonel Boyect JF _|f Consol feneltine : iW + TB own the obove_ clay Firat we need +o _ - __Setup a property Alartup project , b —therte ane multipte , projects Ureler the solution _f i : ___omd VS by default oums first proyectos the 7 ri elhion obey ect 1 0mps progect. _ o > To set the sfortup | p_pabject p property for Bee «é ah a be —_ Aolution exfloror orgit chreK en 27 progeed, sel rhe “Sel @ Startup Poyeet "and then own the a r 7 Notes gp £ ded uyith ew cle 2 j fhe pegect s nae lad with mew cl Ait _Meeel fo jain set Strtep object prperty __ Secoel Prject property cofrotows, 7 Ne epphication what we hove created o1\9! rupsically on Alef tn the game hi» _wohed we see under soletfon explorar fii 1 ___finst it creates a folder sieferiny 40 40 ~ Unde that creates a seprate folder, ore/ei’ _ each progect ane unoley that stem corer poneting fe that Prgect gets savect. i = _ — Ct\ eshapli \ oopsprosect | ooPs _ Ci \ cthapt! \ cops Pregect * ___Nofe- A A_selsction file gots bared coy +S and @ cH progect. file’ gels sqved with v cont rn tteney “pfeatfic - —3> when ever a progect 15 _comprted jt genrades an oudpecl _ re _ Pile thad conta 71 Coote of all the ems _prrtaen? a Inthe pmgeet which is Known a assembly Phese aaxemblies ane whet we cony onto the chinft le a __tohen the spp: hes te be snytablid sr depdoyect, #0 _ they ane reffered! as Unit of deployment. 3 The name of aembsy coil be ame Pazect Home = - ol and it will be present under - uf —_“binidebug\ otsler of cach progeet fodder. . Be Cal eshavpss | OopsProzcet | oops prosect | bin |olebug a _ CSharp oops progect | Second Pore! \ bin \ Debs s \ = Con we compre clan of aaproseot from other cfauer ae \ Of Jame _progect = a - a) 5 dy [enc fooe_alt —____y (those cles wene oneler same prezee! Onel uel? be ___— | __Canpidered a Family pele) Boe a ___ 3 = Gee Gn we comume clam er of eosherprref Por ther _pivyects ? Moh - Wis 3 Yes, we can cormmume but not dnectéy ay Hey _ anne under different projects + To Comsbme Mem > first we need te ack! oreference of the amembhy in which jhe chow va puesent fo He presect whe wnnl’s to Cconume t+ - _ Ge tino to-adel fhe creferedce of an_ayently joa panyec ze —— Ss — An- Ta add onefercrce ofan aasem bby fea prog act __ open Solulon exblmar 9 sight okie on the popect_ _ te whom oeference has to added > Selsct “Add ueference” > chick “Browse” eb on top of the Add oieference Rect the susembhy We ‘sont to to _comume oe it a - fo fo _oopsfowzect « Solakion, Right . t ee “chick on the Second forogect we have aatled now ~2 a a select add creference , chick browse arel >the — eae f nm. Pn beg OT ie. mee ah wae Second fie a Most cs nol waite te following Code | feet oopsporogecd § i - oe a pel a = feclangh | are New Rectongh (20:85, 13:25) : f——_. » Wenteline ( m-GretArea(2 J, tia Se Btcabie Wouteline € ontetferimeter oo); 3 “by 7 Comols. Readline (2; ei = ~ ke ton ate se Hoy GhOgy 5 al |2)oalzate (ey) 5 Aces Specifiera + 0) -sporivate H+ Trternal dio potecteat (a> paises tees type as ui a ther members that 15 can “access phen nel ae con not: oe Seppords five aecesA nahh fey ane ofind andl more ever gery clefault Ou Scope Is pital: nly. Types con't be Geolored _piivede sa private is __opplrcable only fo ynehn ae © SPecifrers thaze axre showing above. '- = ; T? | nt = “Member clefined in @ Tipe with ony Aeobe ov he Pe specifrer Wre always accenesle coith tn We Hype _ i _ Rectnishioms comes in Fo pictere orky glen we ty #0 a oe access them hem outalole of the Hyper _ a = _ j eela te. hi _private_onele onder 0 cleu “oy Suit i 't be occened pubside of the type oe Hele? Tnlerfaces conn't cents any pirrale members in © i then and default scofe_for_(nterfrae Pemba 1s _ ‘ a pubic = Mem bevd devhaced ag a a prtekd “urder @ ele ree act eget enly coh nthe choy or chief an_chi Jd closacy can net congyine Prem eo Tnternal 2 Members and types thal ane declor 1B - ol, con be acceysect only orth in the ___powyect: Goth fiom chutol or non chile Tie oo dle fault scope for any type In CH Is “Tteraval eidy Pade ced Infernal ~ “Memibavy “dedored a prokectoa_ fo __internal_wist have Dan scope fies woth ta ees __ the powzgect Hey behave 9s Zifomel ding oe aecets_to_angusheye in the parezect_, outside = __the project ~ they | wohl (change fo pootectd 9 of e ehitt prude aces the _chitd alesics. Tipes —COn Mel_be decfored as protected gro A type © OY mel vabed of 9 tafe tf decAarvecd ay nel et plabad ém_scope_eahith con be acceso fen ony "tahoe. Acceminay member auth 1 the chibol clas of ano Alecering yiewbers wrth in Fhe Tun cB svetow io" feet et ron vac otelatn — Syboumaénes = How to Reshiel a clan not to be aecewehte of any other_c chasy = — ______» This can be olene_by alec chaning all - the < os _Cenghuctor 5 as potter ee — _& @ elas tot to be Inherited for =) How fo ates tt any othey chews. oe _ - \ 2 Tis can be lene by olecfaring Jana sealed: | 7 8 4 oefiel a class nol | te de ¢ eke “fir ony, a \ other class to comume by creating 105 chzect i. 2 This canbe clone by declaring abd the Conatvetar of the chess ts _poahec ted - _ eck Neus proyeet = vse 2 gets {1 Site Meme ___sctart_longuage setae —9 Choose Console APP _ oreo froy = Fenapicte , home the prozect as AeceesConel esta _Ovel_ore name ee date, a My solution, grote Seee oe (8g defeat the projec tomes with « ofaw pieyrem —— a fedlocaing Code tn if mating the. cmos —pabites = om - — | {Lesed a ee } phe ctu Program - _ oe — \ private void Teds (7 { | 5 I : Q Gide. WeieLive (Poste Method’), — fadernat Vom 7 Tet 29 - _pookected wafel Test) py j{ersehesaaitsne (Internat Method, -—- — —= =-———__— -—— yy z sees polectecl InternoA Tata 9 | x — & puerto _ _ _ - - f no Germels. waniideline ( ‘profeeted Tntevnak Modhecl J) fof a — a | popes a public Tests a Ee oy 2 — ee } Po Compo Wolke line (" pralect Public Meta d "J: \ procter eee _ _ - - . Stee veld Main _ - Pine ft _ a re Pa Program f= nue program (97 _ — er oss Ps TestIO} Pe Tegt 20) P Test 3 (2) P-Tesb 4 C2: P oth ss Gomole: Readtine lp _ r 4 Shale void Main () § Two Obj = need Toot) Ob): Test2O, obj. Test 80) obj. Testis) . aunae resect | = Addo mag clas Hirer cc "anel cosiite — >. F 1 _ ! —_hasy thee - 8 chadic veld Mat) aie Prog yen obj = _Obj- Claw rl? 5 _ _ . aby chew Oj ; | obj claus?) Comnds- rade en | ; —_ oe . \ new Pregren (2; Const Appireation, neme_it os Access Denied, __snewame defautt pile —_Pregvamcs as Four-¢5 40 thet choy nome abo cher =e ne ference. _ Foor, mow adel Accen Demat ayembly from 1s physica focadion te Access Demed progeet anol them withe _ the fellowing Code = [see eae ~ a class Foor AcceaDemol: Program ~ a £ z Slatie veld Main (9 = é ss —— — _ _ _ — _ Fovr oby's new Four 0} — et — — aby. Test) aby Feat 40; Ob) Fests (4) Tae Read line 0; Mame it a4 Fivess ancl waite the foto “Tite ss Using Aceeu Derms PP eases hays Five a = axe _£. ee a an Statte Vorod_Main ¢) - e ¢ \ Pp Prosyarn P= Neus Program C1? a - r IPT epEE ONE a a peta ae Gemsole,. headline (2; = - et itt TAs diseussecl earlior the code woitten int on Can be consumed from othe .ne. lang’s , to te Co this_adel a new project under My solahor the fang as v6 | template ag Claw Library ancl tame the fopogeet an VBRegects ! Micon tha coktechor of iybes ths Aa but mp execukel . Are be +l hers = By cle fault “the przect Comes wed “ches Ca. Loith in_the File clarsf.vb, worite fol! - ob HEE. OSS See i = public clam cRarar a - Ss _ public FuncHon Saytyelte (oie ay ating As _strin _ - _ Relarn “Hella” aia nome 2 nN End For oy —_ public sub Add nvms [x As Tnbger, ¥ Az Intye J Comokr Waite line C xt) oe ses : End Sub = petro ance + public sub tinth [9 As Tulgger,b As Inkeger, By met _c As Thieger . By Ack of ay Integer) ie 0s oth __ = a deb ee had Sule a oo a ~ Grd cf ~ foe ee a - — = _____= Now te Compile the progect op er cofubfens ex pdrrar _origal chick en cthe vbBozect ancl select Buddel —— | thie cempiten cuncl_genrales_am_cusembfy —__—__> i VOProrect teh, = oe me i - ate eee a - Now adol_a neco class Uieler AccesDemez prugecl | - Os Test [email protected] and add the wieference of qnenrbsy t _VepProzect»eltl from ib physica Location then wile ___ > a te _fellowing code Under Fectve clas {- Ustng vePregects _ yp cds Test vee | Staite voll Main ¢) Clays ob" 5, Nee 142 obj Adednums (J00, $693 _ _____inf. X=0 Y=! _ a a obs Math | 100,25 oref x , oief Y) | —____.. & no Comsele tuhonife line (4° "YI _ Y oe Console Woiketine (oby. Sayttette ( Rajy D5 t ro Coie headline 3 - r haem a — —.} poe = = ~\ _ - eres _ _ asl we _ : 7 oo — i$— Members of a clos = _ _ . er = Fietas (ioviebias) > les huetera, . nr = Methods ~ Pooper tes a 2 - Cowbuctoy | Indlexers - ee — S Event _ Ove. De higate. — c alae 7 — _Destructorg — This coke a clays eon Comshu ctor sthad. a_dpeclal me eomtain bed op) heh the object is dlestooyeal. ___ both _lomphirie for anol _fespuctor 1 will have +he same tame that fs cdans it wohich they ere olefin 143 =a os ~_ To cliff between Combicher anrol ofesturfor we = oe “ase Cd ‘oferal®) before the clerhucksr Nethed = “fr clay Test 3 Bs ss eH —_ me 17 tans bared — & is wTest() os é Negba —atole = clesbec to gtd sel ret tne fae. pei, a pon — —__ > A 1 i oe gets calles when, the obect of - clay is deshroyeol ee - - “who _deshoy ed Lote 2 of the clay _ _— _ . Object = Collerfor, ee _ oe ~ “when wikt Gut deshoyed object of the chw f =< | = an ayedt” objet of — a chs in on i BE the fe palsies _Caag s (yeti - dn She fnof 4 GC wwrde destroy Lhe the obs ee _aypetiades a fh le LE abject eleetrayed’l ——- (aye - Sone inne, tin She rntelelle of a program - execution alyo Gt ean_ poy Unused object, ; amodated oth dhe ogvawn Lolich “ane present pr he im ee bod oly cohen fe memory 18 _ full, whid heppews tran phicitly + ageltil) = Wie corn explicitly col the Gl tn forthe poregyam for_ desheymg * ar oy unused _o bye! x the ‘Prego Sing, He ated Gre: Colfec tf tek- Evenif we ane given a chance fo_caif-iie os garbage colkictoy Pxphicit dey it tf new? adviseck Call (bon necemererby bec Me Gro comes in tothe picture [1 wii _ Aspen the erection of the program onl th it completes the ccorks. — Add_o class TestOemoics Under cops preyef and « = lays “Test ‘Test Demo a = é Be TestDemo _ ; © Consol sda ine (" @hyect Preated')" eo Test Demo — TestDemo hj: Nes FebDemoc I: ob)F = Hes TectDemd O; Collec € C4," Ob - Gxeeute dhe sbwe piogram cuaing ch +FS anel ecu 2 woateh the aulpal where First ou ttt finol __ _in_Comspuchy_gettiiy calteol es “Hic object ae __crvatedl_-¢nd then warting for ee [igpat ot _piead line Atatoment ancl “ence you prea foley _ Bamecktet fy oleytety con Le calieol as it __the end of Lyour potegvam: ee _— Now Urtemmernt the commented Line onder _ oy Main meHiod avtd Steetecule the _Poregrain Uaitg = Chl + ES. doheve You eit be fincling one ee 2 — dtstucter getting catliel before the “recuhinn _ \ Of Reaclline because Guts calthol explstty —— a ond fhe offer dlasfrucfor 15 getting called _offe) Readlline »a4 the seccnolofy’ anon Merk 4s Uintlyted « ——= ges veges ee ee _ = : = ~ Add o clay TestDemoa+cs endl worite the following - _ = - Chass TestDemoe + festBen a = ¢ = ie — - = F% Public. Testhemo 2 () Consoly. niteline "objet? Createc!")- oF e i ° A ee Testemea a oe — Cools Wajsetne( “elect? Desroyeot' Js” & stehic void arn) Test Demy Objf = new Féutbe __ Langpfys Reaoltine = $e ~ 146 a We ane alse uate that witenerey the object of . a thas is exe _ PE jk iovekes _/l's parent chases _ Po Conyhacter then ils Comshuctor is inveKecl- th the _ ie ye 24_e cane Same vooy then a cbject of a clea is ceshoyee _| WL ape must hoveke parent _claas deatrotey alan hal’ r ceeie sca, Woigeverze: Divavehy, thet is desfucto cabling r = ~ saith be cle faum. ¢hidd. te_porent- ~ — wohal ig the ge of 9 clestactor ? cr _ > Deshuctors bearcatly ted for a ‘Wimect object th a pre _Inapeyte poe Be ot - e ss Thol ts al . WeKIOY ge s nioy uly oe os Pa > bul gomesimes te Jn bo ut (9. aoe ttesewies ke fig tuitch wll nol be _ garbage todfecfor 40 ose uaet iy ynanayec! LDR efe lang a alia for cles _ —__dalakaye emer tien. sing of {thy ofr ce 14a7— 1 eens a FP popertia Pink me Vids a Glue. vowabhes . _ Ay oclays x $f ab alfio chy totem, any z a cohich Ahoutd be caccemebse Cufaide of Vi the ee Clay _occey te the _ valury can be jen in uso cliff approchea- = i by shoring “the value ina petbbic — | we “Can poovicle_ acces fe _______of the clay bud this gives gou ss \ —___luiite acces or. gel ca access that “i Bon ony A 7 (oheve yo sL-the value oo for vase yal aet the yatue af. ee . a — pubbe ink X= Joo; ~ Tel obj = nee fest; — = ve UY Gethiag the old eld yale panes Be ___ aby x = 2e0 Hf Seb ing 9 Mae adie ena de —_ s B low ny the | Velie —_yrder_a priate variable adzo ae - viele Occey fo shat value ow off the seo 1_by as poet on Het vanobhe ee e Dd akg. HA nicest cA we Con pr acco te fie vale nthe _olssferen) way ta) Goth Get ond Sel Acceu (Readfinite Bperty) vhy ) spony) Fee ee Synlax 10. define_a poberte= — fe [ek moclifiers fiers] < tye C get £ J enom T < Bit of Ong ts >J - f a Defining a Enumatatect Pre peresr~ = P——___.______Te_ define Baw property follow the able — _ Step lin Define Gg ehvim wilh He 2 ted af Constont fo ‘ _ _ be ase under the_p. . be aed unde reper ty. - pthc enim Days ( Sunday, Montes, Teer, a —___ Steptii) Jn Enum is also use defind dete ies ss - Code Coume 1 BM we reel fo decfave o Pe _o copy of re pinged 0 nyse Friday Were Slept) Mew define a froprty on tHE yoriable wo hove c : checi » thed +h property @rhl becom . Brmerabed Bojerty Hamp Exe pee Days Davy ar Lo ctefoin ek cays — ~ set Edlay= value, # oO obe of f_prpertis ACELY “Tele pe ts o new feahiore Hal her Levi which alla 10. give _a_clifferen! - bets section a Exe _clafe_paopety fr 001 Cayjomes clas. i Aectonetic _poopoe fits = Thue one “neoky infer luce in i- CH3.0 tohich ablews 40 clefine_a_ pe) erty coitheat ony variehe for the praferty 40, That papery bi ie ws Ake a vortabls Afring phe vataey _ “fs Coon hy potety in our Clfomer claw. - ss ” Yele_twhife definng_a aulemetic propo ty igs et idatory the sity About be keh a both get crn get hock: — 4 - 7 da Olan “Teskbusleane ci and Woke the fllecng = pleas Toot tastomer ; ; — ee a Slate votd Nain oo _ ee a v ae _— —— ~Caytemer Obj = mere Customer 1 — 7 — =. onto Whotifelline Coby ust 25 — _____lé Avignment_con nat be performed e3 Propory ts vead ondy = [chi Cranes Soyp2, obj Castle 16% 5 - a ole dalfelin € (obj Crowne); _ __ obj Game = Se" 5 Tego renee Console. Wdniteine Loby Came): ~ Conote- Waileline (obj. states): if _f Balance wilt be zer_aa_tfala in -oetee —— i ____Enispl-Utleline ( eby Ralance ) 5 15¢ - == U setting the gah ay Active as obf.tlakiy = Ane, rps tosiiteline “Lehy Skat); — = {Relons the balance — ay Sfetea ts actite Coynls LiilelineLoby « Batonce’) , spre es Ld feainginid pub —— Gonssedh Waitin e tah Balances I Bink ¢ ae .—Obj-dalance = Coo, ff Masingmucl succeeds Canole-tsateline Lob) Balance yy Lf Arnis ewe ¢ : ss Const. KOmnbtine (obj City, parents ~ ele ly Hes-ttyctergbedy Carols ldeittetine Coby City), : Comte, wniteline Lob stat): = Assign! farkd 2 cenen’ of ae rooinncs ra Pg F Hob State - SAP"; HInvobe Conselp-igaikline Leby Countey, gy teat Le peleajsa = Fides =1 These aie dome au. prope ries —— —genvally_definsl_in_o olay te CE a_singy ov Sealey value , that ts present ma olan “wahich js not accesible Outside of the ofan. | Exodby m the dane. aay thease Tndexera Qne Ysec! -le_providing acces fo an ayay of values sulside _ op the clas at a time with Me habp of Telex josrton. rt } 4 tndlexerg _th_define exacts dome | _ t Vath (ret _and Set Rocks 8 feble wing - | | _LEitnditveva®]_ fl Depinra a Tuelever fo acon Array out of the cht public int this Cink indec] t get t geturn awlindeJs J Set {a Tindes] = vabue sf [] Defining a property 2 find Length of amay 0d Of the claw ___public tnt Length i ~ get { return aw-length; 3 4 J 5 = a Add 0 clan TéslArvay.cs andl write tre feddowing- ~ ad 4 3 ~~ Clay TestArvay = : = static void Nain U > ~ [Creating on object’ Initia dieing the avay size - _ ArrayPemp obj = mews Array Derno (0+ di Froting the mnttal values of the array: ae for (int t=05 re obj-Lengih 3 44) ss a Consoft, Wenite (obj CAI 4“ "9; Covpof. Worite Line £25 ff Assigning new values jo the array - = ebjfol = 102 obj (2 :30- ob (uJ = soe |e Arinling the neu values of orve for Gt G05 £< 0b). Length @ tHe) Console « Woiite Cebit ___Congofe . ReaolLine 1; _| | co _.__| Melrgates :- 1 _is_a pointer. to a method hb fee | ollows, to af inveke a method fe Uitny a eligate meted cam he called Be bs" We con nae ox_evecute “aq method 1 iwo = different ——— thin hao das ate mei / chic p and “she name of the char if the metros o atic» | til econ eff 9 me! : even if it Monstatte) stake afin. pao Mote Truokting oY Cabletag froking oY fag _@ mevhoal using delegate jo vs futer in execution, Because “Intenally ;'€ cotll useing asi | tteculton of the method hen berg | times. How bo we delegate for calls Ing me metho os ~ | to we o Selon for calling 0 Method below procedss | Sica? Defining a Delypate- [emedifrers>] debgae voll) ‘tp | -A_delepate_is_o_user olefind tok deftied iat explicitly of we wank fo uc t _ a method’ = ae a A dele —_____—signeluve page dak lepserd ond and —e shite defiving, deligale to_tneke the methen| wake Aue that —f{o “pave. Of ateleg ate coitt “be same as TJo pavameker of method | it hay to coh ol pabhic void Add Cink 7, int 4) j mas eS Gonsafe. Wsileline (xay2; +4 fie a ——— Fe a ee public stebagate veil Adel Bet (ity, inf) > c a ; ae ~ a : public skaHe string SayHeblo Cstring name) _ a. £ = oe furn “Hell 4 name ‘od a: 7 a public dekgute string SayDel [string Heme) 2 ~ i — = septiv- _Crealing’ the obj- of adelante, : 4 am -l| Asa Deligate is abo a tyhe fo comume Ht Shae ki Teed 4o cveate obs of He delete. hile Ceoting _ baa The chjecl we need to Par the methrd we Bont = Hy to call using the defigate as 2 parameter to 4 ' deligade eran ductor 2 L@ : ' . La. a &-Adddel_ acl = mew Adddel ( obj Add) - Saybel sol = neo sSaybel (Sayttelt); ce sis bo = binding o yrethef nol ! : citing a melted. | i eae HR SS — tS a gna aga State Mab (9 | goto ure add inedhed under the cfefraale wae need-fp ol fovfer Ht with esky: o} the clay because non Alahic 6 A _ [members vf a clas con be ompmed fam Static boats 7) soa onby be using object of the clas a [Shep ts) CaMiing the Delagale- novo call the debjabe 40 _ _ -that the _incthed_getas execubesl ushile fd bowned | - with the delegate. : _| - lg clays Detigate bane. Debgatefane.c cs avd sie ‘the following p ameape (e__bOPs 227: ett = = pe et voto Adddel_( inf, tnt y2, | | _public delsgete sping Soppet Cofring #1) , : _ leis Debgale deme _ = ii pe c pots veld Add Cint 4, mty) re ee —— ye Console. Woritetine (x+ 2! oe L i i | pbc tate. gtnhag: Shyitelln (string oe r me t_ f Giebum “Hell "+ Name, & r— 5 _Stadic vetol Nain) © pebgalehenita dfs, Delegaletene : _ Adddel ad= new Adel (ob. ac —_ __ ners Sqyb ol ( Sar tetta) ed (tee, F6)! el (se0,28 ) sed (2 —Cuafstdaitetine (sa vu )y Comal Woiteline (st (Ashy') J: eo _ —_tnnsoller Rsadlline pe aa ee oo Types of Deligates—2 vakegatey are of foo *ypes. | | J-Uni- tosd Oebgades - - tf a. ttull?—toal helagaher- 1 a Gf a dleboate In used fr mvolsiig one singh 8 \ __ ___Methsel Eb onfloradl ay Ons Cast Deligabe's = where ab if a delegate & ugeol for mvoking- _ mobile methods 1b ib ore(feweot ax ‘Autti ost : J Telage! __ ee a) = —_Usin ca we want to Moke multiple 7 methods “all those methods piust have Hie Mme Tlo Parameters oe Add a cha saiisiinom ond _vooite the foiloaig- =e i chow Mul M Cast Demo mere _ E public otelyate vold vadbnet Ctl 9, ind 4) ss public void Adel Cin, int) y t ore Couolrqniteltne (Adds + Geryy )p 3 a ved Sab Cinfy, iat) See Ulaitetine (“subs Ged): W200 °° if |) ) 4 —| Sep vofal Mul _Cint x, tnty) ef ppb ‘vélel_ Div (int inby) Crab stsieline Ct OCOD: Pe. 4 ‘pltaok: Woitteline UDwits Cosa ds -— \ : _ | Statte Voyol Mein U7 r i t re NulHicaxtDemo old 2 New Mutt Cast Doms Motel nial steno Mathdel phy! Ace spe fie > mad + = _oby Sub + a pa | Wid & = oby Mul j : wel _¢ = obj: Divs Mol { foo, 25)" Comaofe. tdoite line 1) rm ( Soo, 15)! Compote, Wamite line (2: umd = = obysalivy “mo [600 30; Consoly. Reaol line (24 " Ananymous Debigate Or methed — = This war new Peatwre Hat has beer . added under Git-9-0 that allows ‘you to olefine | ~ ose ali debsgade Lolthout sy) _Seprate methoel fev _ & MivedHon_usheve the tontenf of Me method _ Con be nto chive cts omitten under He leg fe _it-aebp Cohide moating fs object 0 That the defigate tay gtor® working as Helkool ofto- - : —— Add _o class Anamyrrous Qobsgate Domo. Gs “ool Walton \ a, _— sea: Aatingsibea Nel gaecbnie> —_———— ~ ie oe = 3 A ; : oy SayDel scl = ser chebrgate (sting name) =~ L : ot return “Helto"+iines ! _ a F : ; A Como taamite titre (scl (Vaan 9): Cswolr. tsinitettine Use Asma") ): - Comols -Readlifhe cay i VE Exceptions cel — - Exeaption ond b'ng ~ { a 4 the devlopinent of on apeiea there is aichonee oft tevin asroys tus ol EL aia Aol af Ears: sarees (i) CrmbpQe' time erry _ eas s n Hi _Avs time exvor | st [Exons sahieh tomer_in tp pietune olue te aed mistake ov Comibife time error - thee evrets as1e not clongereous andl need! \ © L mt be taken in-to Cemslolmahsn. — Enea thet Comey in 10 pichee oobile ex etuston a of the rgpats th daksing pace om sin tims ener [ eohich Gomes in fo pichoe olive to vavtots piece t | € fike soovong imphirmentcte es7 Lpgse mr ksing of feat { durc® wren, fipt Anppty foo ee program ete = = Runtime exor, ane ery fongcreacy, & tah ever they 26” the pogrom RIWiNte c eutometic Aenea Whe ihe Do Geereet uyrthout ee tedng the not un _ | even (F the twode "3 no wey s.otateo! wit — , | the ermr emmy thal get occured . a I 4 - Fink Whe crespomsible for abnormal forminulo of a ft wogv ombvhen gsiun- He © T7041 O Ctuy F exception obj" ane qieaponsibte ee _ r CL | termine of prgram whenever . 7 i “peta in nan: 1 aS EEO TEN - a “Hin hae Excep lions’ ene tmptinendad ibon aly > Thnfernally ExcepHten ene _impfmended % in Aa, where we with be fretting Vartous a Bxcephien, hanes awaited colth of/pp. Aype w ~ ob tm -Hme errors, - __ Nute- Fer each cift type of Runbine Exe - i tho may cer (nthe program Wwe ate” 7 provicied a ol’fferen exception cfaw Gn | _ obj. of there clave sift Come jn be pickne to terminate the progr abhermelty on fhe. approprrete yitucdtt nm anel ato Uopla. oh x LwwY Move gpeific te the en ov Thad got 4 Occur ed , _ a 1 — = ™ “7 i Tnternotly the Beception anes ane tm pdbmented 1 ay following - - - = 7 ~ Exce pitov ‘ 7 _ ~ Fema) | 5 i SS - “ i ' fa T nrewnge ie ae : Formal siete Bye" Re fremce sitet —rreptim —__—_Fkcept'm _ Eetepirm | : = | ‘ FP pio BOlOSte 4 : |Bucepton Handling -» “Skis a procean of stepiny the __|___abwevmeh “tevminakim of the parogran sohenever | exceptiama ante going tterwimate the poiogram ae |obnormahly &o thet you Reve _o chance to execube | all the code thet ts not ot with -the exception _ € and abo you fave a chance to take @ corrective action 4 cc — —+th_any_tnexcepetedt Cope = Sf we want to handle an exception the code muat be « tncfoyecl under gome apeciat bfocka Pike hy Ich e _ | which shoutd be uneol as’ following - = \ a Syninx:- 7 HY i ‘ = styity which with came you a oumtime ©7970" e i : = stmis which shew wot execute when ovuntime exes Occur $ Catch _( ) L e > Stmts which choutd execute a when swntine cmerd occury = c t =e multipke cadch blocks if stegtaved 7 — ft > Dee the tode twolesed under ty eed ante! e ne execution of the _ pega jokes place as ff ty Sat te ee got-exeeute Succeufelly fiom _ | the fast of Py aythort exe cutis 7 . | Gade bhoel< ade divectty gumps. to _ Ok that ts _pYeienf offer the cafeh Lfoc! if | «4 | bos fy hay aint wel fy canes an aner fom |S that ling “withordt exe cuttin emadatny Atmts OF | A Ty Contvol slivecrty jumps isha calch tlocks checking | J foe mathing Catch block. to _henellr the exceptions | CHD _ GP omy coteh Boek com honelie the exception Hhat got ‘oceureot abnormal termination steps there then @rceudes the tode Onalev -thad cadch bfnck and fiom there it oltrectdy gumps to the fiat | [ Shmt= after alt the catch bfacks - “a4 a i 7 DSP there tno _coleh dfock Yhecl can hanolfi the ~ WW exception , abnormal termination occurs again. = 7 > _ Add_@_chona Demo cs and wogite the fellpwing— 7 - 7 a ‘ class Demo ae : & - t Stodic veil Main ty a = ; : _ e i mE XYZ) ~ ey = Ts — —-— _ © Congols toriteline (“Enter value 3") Xe Mts Pavne( Comode, Reackline 6?) > Gonski Woirkeltne (“Enbey Y value"); ye inks farce ( Covaobs, Readlune 1 ); Zs xiy _l., Consol Woitetine 2 5 | Cobch( Divide ByZevExcephion ert) ie cckihg | Consol . “Weitetine & Dion te tom nok be zero"); _ J ion, 3 -— e [totch (Formatceptfen ect) : oe 7 c a | pre Com ole: WouteWne Ener Neéameic vabte only “J+ | 3 _ Lestch LExcepHlirn es} \ 7 —— | - } cr brisofs ulsitetine (“ Frrov Occuredt"); — \ - t _ Consols-Wortteline ("Program Ended "J; _ & § = = ¥ _ x > Finally Ghock—+ This t amether forts of tele which e toy be ime paired with hy anol Cok jie code Bie under his block gets exe cutecl at ony that_is even tf an exceptron ocuny Occuy ov abnevmel terminaten eeu rf chow Fiademo - | - £ Static void Maint) £ int KY, 25 Pfs a tiniletine (Enter ¥ Ve! = Int Porse ( Covel Readline ( TS Conti suhadte C" Evtey ¥ vabue 2"); Y= Int-Pavae | Contos . Reaellnet? ); a vp [y= <1) : _ return j - zexlyt Se _ Compl Waiteline ©); : a 5 = __ - Gakeh C Exeptton ex) - _ ; oe es Comoly-witeline (ex Memage)) _ * jo a goa finaly = oo a t : _ Goraohs Woriteline C Fvally bfock executed!) ) 7% : ut ees . — — Couch Waribeling C' Rogyom Ended") . Z —— a p = - - = _~ Note- Run the above progrom so thal you get om ai Exceptin as well as worl? not gef excepto where you oil) be Helicing tr both the two 1X. cajey finely blick gettihy Exetuted, Le. _ Now ¢gain exeede the program by giving the value te the Taivinoy ay one 40 thet If conelldidis ig execute and orelerh Ain! wilt gurop out-of we _ method! dul only after _executton of finally a Shock because ence the vonted erter tr to PY _ weading Pimably ue con net sop the Centon: BIOS wifosfiz iy _tatch ond Final con he uxeal sn_Here | ‘ombinations: xs } 19 “Ry ond fetch. dn this cure exceptons voitt be handle | ee; “0 the abnormal’ termination steps. | lid Thy, catch ond finally Sn this case the hehavidu _ | _sotl be some a, above bub even ip abnormal rr termination occur) alae finally bfock wilt be a execubedts 2 | Tia 3 - . - - | = | ii) By_anel Final - dn this cose abnormal termination — =e wil ner stop Tifa owntime exox Ocr ——— finotby block geta executed, _ pL Message = dt a property usnich ‘wreturns +) Mag. thod is associated with “He excep! Thad got _eccurreol catrrent ay - mo ——the_property Mewage ia decdaved ax Vitec ——; the los_txcoption giving a chomee for olf ii) _ Clones fox oderiding “the prop uy _ . Ee- Public clu Exception zn a pbb virtual Shing Weesaye [7 Ralohy f i x cr | get Uneforn “ = ze , 3 Publi chess Pjvlelely2s0Fare pllien € : : a pabdieoverncle ax}arng Mess ge S$ _ Get g getorn “Atlempted do 0) —* ee oo Fee pat ata age dy-evertiden by the chifd claw the reference af the olay Execption a hes Ce atect using by any of che chitel clo objet can fnvoke the chit claw pr per ty ten = a (An us, ebove poogtmn ex Mesage ts _printtt i ae evar menage aunrectatect voith chrfal wes _____. ff§ ba-not of th © fone clay Exeepiions oy i Thternelly the chitd Exceptions dauey aye tmplimented as follousticg = | Cy RN dis Heigl Sepia f , public override shing Merge Sige eet urn ® Tnpubabring wax not {na ss _ cortect fovmat “1 Ff m F ‘ _ A _ = ~ Excealion oye of two types - iS : ~ aie eels iG) Application Exception - _ - a. 2 At Excepiton -phatl it eraithest simplicity Pn 2 defind Godlition is a Syston exception. 4 En. clivide Cy 200 Excephi Formal Excep ey, Crorblow ete Exception eon also be wratpheol explicitly al abo by the preqvameva with th an opphitadtion th an desivecl siiatten- Ancl we call fhese Freepritr a _ A ppHeadion Exception: a ves py = tris How Can we siaise on Exception explic ity t Jp we wont to oie an exception exphnitty foltow the befow proces = = ce. ep) Create the object of an exception clas. r Steptit) Throw that obj’ which has heen created carr threo ftw achertemernt + ee L € Eee Format Freep tin __ x 5 “nes fornia Exeephon 0) - er throw ex; as eal 5 = Hhyow news Formal Pxception (); _| De phi, cater houtd be Usedl for }hrowirg | r exphic ity. _e| To thyow an object of an ExeepHon class © F We ane given with too optons: ec i) (veate object of a poredefined cloas Apple f c Exception by _paasi: mg the erry Mersoc ze peigasiet to jts Cmipuctor and thyow that ofthat the given Ener Men! 5 OS le siecle. til escentraal_ionts a a i * | CO Define your. own exception cdaw by z eke. frm the predefines! cha exce piion a vevvide virtual proferhy Message onl =~ objects Of this class fo -Hrvow wher) ov sie gsuivedts at Class Throesdemo - Lm t at Fe _ Static veld Man a _ Gili Gi ~ Enitey 98 Vali ia) por mre _ = int: Parse (lonsols. Readtine W) 5 d Console. Wenite line (“Enter ¥ watue ") eet Parse ( Congoli Reaclline OD; _ ey a ee throw new odlelNumber Excep lien 3 How new AppbicationExce pho |" Diorser com! bbe Git odd number"): —s 3 : Ze xy __Compolla Wenite Line (2) Consol Weaiteline * Paagram Ended"); a. — = NomberPaceptton : Exception _ Public override string Mextag e é 2 2 — — gel £ vretum “ diiy con vot_be a odd numbers Jo = Mor Utitizabion of CPU Resources) me = _Mudti - "Thy fading = Time Shave a n~_ [__ ASinyle program per forming yathip te ! ; cs z~—-—__— Se ere mubtoreoudy sien van a _"Mublr Threacting | Earhiev we have on appirch Khowhr as _Multitas ising eve _muulkible program cen un at the time nr _ ita the suppor} of fc | Windows tao MubH Tokina ¢ [ + uA, oe 08 which sblows any numberof pagrom fumat-Hhe - }—Seme Hrn here a, Dos i ing 2. tasking 08 — P11 case _of multithreading to develop ony © | mui threadeal Model jst lang's shoutel \ c =| support put the longuage Tnbern abl. Pa ete f OS agam- _ 6 _. : | A Tinead_Isa process or unit of- execution Re ec for executing Hie parogram every program 3 has_one +thréact fe execute the program Hh —_——____| Trea" 50 every} pmgwom by dlefeadd jf is . & GH) Maximum Wlitizadion of Resource —t The comes in to af prtune only eaten the Gt pitnclp fe Violetes Hab ts ~ if a thvead coufsl not execute th ith given time for é Some oreason , withad waiting for the Hrvead{ fo execute 5! Os atwi thea he Comtvi te other tHhiveada in executor, | _ | = — —— fe —— —f- How -to_ Create _a Tireadinn To creat a thread we axe _ __prvided with a clas thrend 80 each eb st you create for the chess thése js a fhred the claw al — i ineso!l present vloler the. System Threaclsn: —- A. and while c¥enting ‘object of-the choy you muat pay Tre iethocl Wome a4 a _paxameter fo iff Comatrecfor. en System Threading Thread (< ynetheol name >) Fiore! tt = new Thveccol C Method Jy Tiveod tt 2 “Thread ( Hethode): Thvesdl té new Thread ( Heth od 8 Members of Threadt Chaab =: | Aestaxtt - A tetiod which starts the execulion of The thee. Cx Abort (2 ~ This method terminates the execubion Of Threack r > Suspend - This method suspects te execution oof - ste Shs thread 40 you con Resume I again w _ | 4 Resume ()- This methed Resume the execulion of Suspendes a _ thread = ¢ 5 Sleeper - This isa static meihod whith Suspects the execution re ofa thread Unit the jiven time pertvel alapa. fp & ton - Sf “his methed is cableol en a Hrreoc! Main re i methed Thread hes fo wait im the program «o/thouk | exiting until the Threaol which cabbie! » iting - oO [BProvity 3 Jlis a enumerated property ysing whi we rc can set the pniovittes between the thredls 0) se Creclion in Sharing the CPU giesovrces. a c Add o class Tiread0amorcs and woke + Be _ | using syptem. Trreacling 5 a _| hast TiredVeme. si 7 ip | é = r : Thread 1,2) : pt public TireadlDemo (3 a a _ OP = LS eis Thread (Test t2; a nm R= new Threadi festa); — P | = tShrtO; fastert OF - bony | peo veld Tel) | —____|' 4 for(tht C205 Vecteos tea) , A ene t ce i " Consofa- Wonteltire (“Tests s "44 Dp _ = - y ae % osdtip Ee JS —toneotes toottetie (Thread exited a te = pubbic void Test? S - z - - | for Cintk= 1; Texto; fe) : \ —— ag! : —____Comsolh Woriteline (Test au" AIS a \ 3 5 ~ - Te _— Genco fe Waritetive (" Tred? exiting ~ me) so 7 i _ yoil Main () - sae read Dero by = New Thread Bem (3) s obj tigen (0; a. obj Ets Dein (05 7 Consoly. woiteline (“Thread main exitrs “J; 3 gn Mublitfveading Wie Tread whith — Complde Hts | a “work an erit from the pregvawi «So Tf Mein threat | _ Gompida TS wok Fira mn he program bel Main Thread shad not be allowed do exit from fhe prvgram Vaiidl all eZ other Trees ceded were exiting. —— —-— —-- —__ — 178 ——________ ~ w — Willy Main ond afap Emol wit Main so to make <= te voaid Uni alk tite thvends ae entifng an i: combudawry to Cale doin en | x 7 en aa a — Thread Priorities —t «then there ane multiphe threeds f : fregeaktn Qh : all the z| —lhvesd's wall be shaving fre CPU “gresovrcey eg'vatly Pegi Hales worth Aomnos PB, a if telly Boston Z the cp oresowrcea to “ony “Thread 1 exe cuhion \ —Pavicled it has move work fo dle: tahrch con bi > —by-setting the enumerated property privrity | Baa of the flowing sabes al e Wotngs is (| below hornet c——_| Normak (default) _ — — _| above tlvmal _ oe Highest. Thred Tis 72 Canunts Counts a ? \ i th ghey tO p Aasstard) 5 publre void Ther Countt 0) Pi] Let yy 13 “tsithe Cha) A Gounlf +24 5 _ ~ (public veil TrerCound2 0 a. € > F a ~Colihe Curd 7 tewnl2 = =a = Sa | State void Matin 2 2 + S g 9. TWverdPemog obj = new Thread Dew ert in _ ; ass 7 f yw Sd: by tle Abort Ut _ [iar why: bes Abort Oy - L Thread ai (se03), a Zi i - in tas Nef coor )y LA Conso fs Waite Une (* Comber" 4 coonteds & = - $5 aa In Me above Moyram we ane | tnerementing the two “Court Voricbte in an Indefinite Loop utder the dwo oe iff Metheds end we anc calling Using tao Diveedlp 80 the feo thresds will snore the dime beech [a eachother and zherements the kes verishfes . A = Became Beth He fe ‘fhreads le gpitty ¢d ghare the . CPL oresoercer epuelly Carmel Biorty) JF you oun Whe pagren fe midfple Ames, some of the Himes Comtd value will be hiker and some of the Times Counts velve woth | 1_ Fes 180 o { atdos|if | Th check the priorities between “Threads eyces)f pour —{-pargrant _b ting the prtoritie: between ‘he ‘three = using Hre Parent ty fro perty «doth ong of the above 1 value, Shave been discupiecl enrkies. a Th_ael_-the priorities between the te Ahveacts epsife os _| ve Talining Gade under fhe Congbuctor before cabling | start a - _ | UPripvity = Threadfirbrtty, towert) - | eC | 42: Prioytty = Thread Pavmity. Higheaty Ff i Now again oneate the pegram for micMl') fe Hime { Feces and phecte tf out Most ef the time count 2 vetue aidd t _ vetigher than court One, Kecone Tired g ih exo cetiy \ : with highest potty anel Consuming mote Cy c 7 | thay thread t+ - a Thread lockty Thread Synch enizatid: nou “1! fo _examplen of threading we | : vain a Aeprate Hyreacl for cabtting fi r 40 each threat 18 add0ciateo! with a diffe fo we nevey hare any probdce in fhe excudion. Gut some tines there Can be multiple Phread program executing or Calligthe same method ane we will be getttiy -exeng oicaults 1 ae to check this aol A Clan Phreo'Hemoeics on ___| | Rilewing coole— : - = I i vig Syston: Trend fo oot chor Teal ema’ - ae — Tired U2, : public “Tired Oemo3 (2 fe EE ft news Trea CObpeey), i | th new Trend (Drapes): ~ dae nee Tiree Cop haa) i tisk, “testa 05 thestm tt, 7 $ Uf Asynchronous Method publi vod Display» — e - Conk. woiite ("' [esarp 15 J: ee! Thread» Sheep (5008), _ Congefe- Worteline (" object Orietted J” I; segues fi 7 Stele void Main (I - = é Thredfieme3 _v —obpett Soin as bjt: Join 1 : a obj obit 092 = new Thred Demos 0 dn the above pagram free Threads tying the call the a. deme Disploy() ato time _and thal the medticol of a Asynehwrout Hethod ft alloug any ruenber of reels acces fhe smefhad at same fine 40 ihyou sun Ae program fe with be getting -Hre meratt but - vot ap_goo ep pected _ Jo overcome the problem you shoul lock He tode under the dixpay “method 3 phat “the method become _Synchaviibect eahth adopt | alton mutétple threads . accegs “the mefhoct af the game filme. Gt aly atlecys Oe Av . intel 4p call fhe medtool af 9 ghen pint of Sa time and wntitl the Tinea _cobiels Starkxel the be __tketukin com pletes Ale werk Me ode? Tree! con f 182 access the Method: To Make the _methed 9 aynchoniand, fo crecssile Fhe [| T bynchsentaed Hethool publi void Display £ “doc Chie) ’ ifode under the clispfouy Cd methed ca following: fonsoke Worlte (“Le sharp is "J; Tiveod: slesp (e000); ___Comsobs: Woritetine ( byeet duen Re execute Me prvgrom agadn do check the oll) rm oukput _Fortiok Choases —! Wiis by @ ree fakeow [spite the code code of a claw physically | mm je rit Unis ov files hut Logically (he one only + | — Partescs Prot ocs been added (in GH 2.0 , which ables to a closs on move than one frie that vs we | chats fs? 7 partial Pew Farts & Methed.t (3! ” ~ Method its “Hethegets [Pe —— tetods | ¥ a Wetheod - Portal chats a ~ Methoal xt aE we we wank to ‘lepine. @ class on mulhipee # _| all the files the name of Me clam That be Aare - and we need to uae partial modifier on the each (le fe telf dhe ake partreut classes. - > Pytial cfaya are heel woken we want 4a obivice or 5 “seprate | tise volumes of Code 40 that Organtety . become eaisey - . a a Patra chenes atloay molibde programera woovis ot thepome chous al the some (ime: > Sfa perttal Chane has to be abevibect from aj ofsres | “olan ib with eneagd ff we meré im any ™ Aingle file nef vieqejree! to be Trhented on abl-the Pies « A 7 7 ; < _ ~ ~ _ — — = = a wa _ : _ a a aE > 7 —Udindews Prograraming — [ti They ae net user friendly, becouse oe 1 + Fradibionally we have erly CUT 9g: DOS, Unix Os | & Common Con bobs ¢. Bey | & Confainey Gnivob Dale tonto | F_ Reporting Gon frals c 185 Si In devckpment of an Hication we need o user | | Mterface (UD) to Communicate with endl users. | User _ interfaces ane of 2 types - i “F COL (Character User Interface) GUE (Coaphical "J t r I [where thee apphietion suffers from pew criltsiiy feam He Commands Firat to ane them (i) They do net alin to parvigake fiom me 9s | Te solve the problems im carly got Guz appliestirn inboduced by Microscope with it Windows Or, \ 0 beautiful feeture Known a "leek! and Fede” GUIs they provide a fouganse alo in Jo's onty flater when Nel wa inboduced ‘the aupbort For ou given inal net tang’. Developing GUT - . To clevelop GUT we need some special comp [a Cobol which ene, provided directly jn wel | Clases jn System. windows. Forms namespace. = Alt Contiols thal ane _providled, were group ec! Upfeent Code series bikes | { | | 3 menu's and Teod Bar ia | Ofaleg Conbota ee scl What evev the ‘control re waa a every “Gael yas | ! 2 things fin Commons = " a ) Profertiea— These ane aH wbedes of a conhod - which have theiv fimpact en Look of the Conbo?. __ Fa; woldth, Height, Back toler, Fore cedev ef ti) Methods - Thee arre actond performeol by 9 Conhos = Fy: cleavO, Focus 0 choaec? ete I ia WA) Eien The ane Hime povaoks which specifies when an ackim hay to be Performed. a _ hide wad , [kes Prem, Mowe bver eter Lim > _tote= The parent clam for all te cmnbob is Daw f “Qmbol* which & cefinied gsith abl the properta | 7 __wetheda aut eventa that-ane cemmin for exch > Cobol fike Gutton, Texthor, Form, Panel ete. hate. How fo “develop. a Qwi? = Jo Develap a GUT the base Contra that has fobe Created! Fiat is Fowm To Create q Form define 9 ~ _ clay inbenting from the preclefind class ‘Fem’ a Be that the new clas abo bewme a Ferm, -_ x. public olosa Forms: Form eS x 7 Teen the fom we have created call the alate A meted Run Of Application class by passing the object Form we have ¢reateol- Fomt f= neo Formi02,/ Applicadtan Run (F): or these cmdarlap a exinenas application either by wing | | lo notepad foflseaing the above process as wet as vncler uiseral styl abo ping * Winclous Forms Application” ect demplafe. — "seg innap Appear wal ifePd | __open note pact pwrite the following Coole init save combihe | |__andthen execute 5 _ Caity Spiers - [ting ayiem, (tin elouys- Forms ; — publican Bont “Form & Stabic veil Harn oo 7 Pppbcalion. Rind nea 10): t _ Developing Windows Application uredey Viual Stuciio | - Te Develop a taindouy rdicafion neler Visual 4 - [open new prozect winds 4 select ‘Winclouy ferme Aj | pragect Aeraplate and _afecify @ name to the p» £9: Foumafangect - by d dlefaut the _proyect Cones coith # Fi = Formule = Presa <5 | Fomics ta the a fa hich @ chase Fore ee Hse “the. “don fi vant Oy orliat ahtsh meas _ ibis defined on muthpPe files, Progrannce ce ty the fife woh teh Con tern @ Stale ohana Pragya. | Tn this chase we Fincl a Main reWied i “under which the object of class Formt fs createct - for erecetion Gs following « i Application Ron (new Ferm!O); ______Bate= _Progvam cfs 1a the Main en! : poink of the = (hin eecutton say ts. fads applicasiow Cevels ped under VE hos 1 2 placer | de 0 ooith: 1s Design View = i As Code View ~ i wae S ethere ay Coole Wee is the ee where we waite code for the executin aii OE bs a accessible Cnty fo peyome rs _ sos ole Because of the Design View uohal Vivalstedio _ prrovicles rl os kmewn of WY cjd¥g, IDE LL “ obedica- As we ane cware that every Combed has reper eo ___Nethods ond eventa_fo_access the properties ofq __| t Combo? Vic provides! Proberfyroindtow thal aks all a ‘ properdiva of @ conprok, open it select @ contoh. © ee and fregs Fa. -we_can_change any property in dhe f € —. hak of_property uncley property winoto Ske voit, - os Height. Backentey, Font) fore cofer eft.» for wohich You senses | Can See athe _fmpact tmmecliately. = a é = when ever _we gel a vale 4o any poberty elo olan }_ander_pooperty windows VS on behalf of i zl outer off the necenary code _crqferrtig 4o_ cach: pe a ___byayianing the vulues we Inve specified - 1. foludpw “te com views -thek Code under I ~ ment meted ef the cham wh ri | Crater: cl _ [= Te view code under TnitialfeeCamponent! () reilod e | Coxe view. onfght ick onthe method thal 14 Cable! | Conductor and select go to definition vahich jokes fo fmt) designers cs Pte ond here abso o" dame fois Forms becoune i B pertials — | Setting “properties to Form manead— uhit | _folnssing cocle_m_vokepodl cd recut: using Syste ; ling Suatent. Drawing p feb valng Syhern. Windows. Formas pubbfe Bary Porm 8 + Form ] _ —— 1 SSS eee fen MVPs TT Riaieetnpnms Fed “Tai Mater Cem prmend: () this. Tet = ST at Ahi Backonfny = Color. fine» - aa! dhis.Size = new Size (350,350); _. af 3 Sheltie vid Main (J £ __, Appieakion Row (Med Forme Je a = a _ — ~ y Eventa- Fiae axe fime periods pahiclh fells whesr an a _ econ ha te be performed thal iA when Exictdy n we want to execute a meted . Every Control will have nos of events under it tohere, eae event Occurs OY Sialjes EM a _parfieeuay time feriods > a a = We can acres the events &/ a tonbok oy 0 under = property caincled onty. To view Hem pn the property < = h cose evehla Teh on top of the prefer, ) :- Lf we want fo. wonte ony code that Ahoulal execute “when an event occurA olouble cLick on he Atsireal event carter ponding. to a avert eonboh , which taker yeu te code View anol provides o methods — A for writing He code i a 190 _ 7 Sn fhe_prosect we have opened , 19d to. “event of the Form), doubJe chic en toad event and ussite the follruin = Code_ondey Formt. load meted usheh ty genraked fn | tnde Vig 1 |__Messag fe: ee (s eheome Po iain apps ee > Apsin go to clesign vitw, double elrce om efit Event [ane woke Pofloraing cade under Formi- chide Methods -L z| {MessageBox show {You have obcked on fornt “J —_ : —4} € { 2 | \ | ee 7 a — Que. thal: happen, gohen we double efick on on ever | Conko£ in -the perty Windle Cc t pede frs~ inher we oloutfe chick em _an_event_in pre) an Internally @ methed gel genratel fr w r i | this metfiod Has a apecral name event recess wy, 4 black of tode that Bs bound wrth an event al - ond ge executed. ehene rer the event {ot x fe Me code written onder event prorectwre wi l( & St the event wen it occurs “they & she a—-—— by SS SIS TIn LE Ones om aA — lel gate Fnternelly @ fillessing- (obove fly ads | 4+ ~_n the above cause whenever the event | e delegahe which then hh Uxecules ——3;-— - a = Berne a defogete ch sestaribte for exeoatin of Evenh wicedure pl the Event, delegate and Frent Procedune with be bend with each other an following ° _Syptax :- -~ al + = new ] voto (object Sender, EventArgs e) g © L Xstmts>: . rn | oF ' Event Paccectwxe axe non value returning methods i T _ _ pe _ |- An Event Procedure can have any name but vs { pa Convention ahife woming the event procedures i | Lconkok name> loool, bubfon Chick , feet Bort - Key foes = COVERI PS i s aaa will Bke @ nendaloy fo el L 1. Obgeet sender - [ [- & Event Args & i “| nile the Pollasing cade ina nefepacl amd Executes OF i wang Syster ee —_ r | wig System. teinclous Form: 1 __ publre chess forms: Fo iets é r ans - Poblic Foams Triffalice Componend (2) 3 — {abn nino Bventiter rclder€ Test Pe 2» Eventlond Peel Fash!) pale wold “Test Pro c_lobject 5 apuler. Eventing oO tig Message Boys Show |" Event Paoceduste execut eal”), Stabe volo Maun (2 ¢ Appdication Ron ( mew Forms) )- <4 : — Note- Re concep? @ events ancl evenf proe's has been derived from cfossteal Visual Basie language buf here an_event proc can be bound with ondy Ainge event of a aingke contd , where %& in >Nel ft con be £ bound with muttiple eventa of a siighe tonbel a welfar wrth multiple contols alsa Adding a new Form tn the pragect + AL_proyect_can_ con, omy number of Forme in to add a vew Form under ou Forms progect’ open sofution exploray — Sight cBick om pryect - i and select Ad? 3 Winclous Fos Which adds a nee Form Form 92s 5 To wn the new Form ge te pingrom clay end _clige Code under Appdreation Ken naethod as Porn? _ _ er Apple jection. Rion (neto ove (3): | Binchin ‘on Event procealane wiith_imultipee events of a teenth” wh de vs- i _ After the new form Ik added! to proyect. ge t rts even’ | a Lond olouble chick oh Load which oefines an Event Procele| { f | "Eom loack’, Zo bal the Aame Event Procedune with oj Riek event of form alsa agatn gn to events select | | i “chick event and lick on the ebopdoon'Besiele whic Akplays - [a listof Gent greccctines ouitalide , Select *fvma led’ | 7 = Event Precedluse thet 1d defined previous hich binds the | ol 0 woith olick event also row under Hie froc Un It i \ Pen following” cade and execute. | Me agebax: shew Cound ith mulkiphs ovis of « GoiotD__| gating Conlrok on a Form 3 r By default we ane prouded with ¥ of | enbobs Gahere each control fh @ eboisa these cor i $ avilable in Took Gor Window on the Left hand a/< we | wit | Siudid that clisplays all the control , which ganized = | under cipfeent “Tabs (groups). = 2 ~ Te place a conf on the Ferm either oloubfe olltk ry | en desired conprl ov select the cenfrrt ano pio ie dlesived (cation On Forms _Note - ie layed fool hin Conpcls p/ -_ Bing an. Bim Procedure with Mutiple Control Addo new form forms inthe poeecl anol design it an foHlorwins- | fete] define a ofith event pPrecedune fer Butient =o anol Bind the event peoc with bytton2 PextOorl, Jext@ox2 anol Pown aluc- [Reet i [lett] fetter) dite the Following coke Under fhe Event Procectuse __ bitten — chick" ~ MessageBox « Show C* rmtrol th clicked ")y form 3 Tdentifying the type of Control when evenl proceclune 1s bound totth rmubtiple (on trol. Add @ new Pom and clexbn 1€ > same as _form-3 S befite_a_cllck Prowl precediore for but tonl and a bind the _Eventfrocedste vith Gutter? Textdoet fee as wll ay form abso. a | =nlow Under the Event Pocedluste Brttons click : vovife the foplewieg code oi Button 1 clicked (Sender object, EventArgs €) ~ ‘ ip _Leonders Get Type «Name z=" Button!) ~ | MessageBox shorn (Bullen ps clicked) _ tbe if ( condey-GretTypel): Name = = “Text 6x2) Messagetoy show (1 Textbox ts clicked“ mn che ‘ = ~ r Mepiageboe show (“Form y rs biked DS “ie i tdhs:_ov event mbreckuone jy bev ny exit mudifele Cor bolt eae com den H which cmpof cs enecshie Ye a ee pei tg, v liste wlth phe a + Sender fpareneler of Ever! Procestiore» = =: _ = E56: = is & pee ecaue | Ronkime the object of the Contvol that hos oramedl the event yA cel fo th oceduse which te captive Under parameter ender “uohtch can held oxy§hng ttt became 1Ld we. of object type. _ [Eatiens J - - ze ~ - eater} > Event focedusce | e _— See] TL cz. _| - [ReetBoxr) — ——_ fterkBox Ce | can a ——— eee creel foo & _ —— ath Aa the object of the Conbol 4 of the Cobol class ta cophred tr en sender _poramety phe betTypeO methool ef objet _ can Fell you to whith class the objecbs 7 z do. Tent fying the exact Control That ha; . event when an event procedure 1a bound 9b - ; ‘multiple Gon bola £ J Add a new fom Foon § tithe pogect fesign Tt A same 04 own. ; — = | Define a chick event pre for Boltnt ond find os the Event Procecture woith Luttond, Tex! exh ie and Poms alse: ae - Me _ i eas - chick | (Sender objec, Bernt gs / are 2 pew Bender 7 23s Guite “= if Cb-Nome = = "butts a Messeje@ex. show (“Bu thm ts clita"); Ls. e 4 _ Mettage doy, shoe (“Butloe2 ts ‘chiked'): Tt a che if (sender Get Type) Nome a2 “Textéor”) ALY 4 = —_—— sae Spy Text @ox tb = (tenttor) sender 5 _ _ fd bbiName c=" text Bos") : i | Menagetoe. chow C™ Texffioes 1s cbisked" J; _i>4 2 —— + Henegeboy. ae (“Todbor2 ts chkedl J; [4 [ | the : : [2 — — { ‘MessageBox Show (" foms is chicked J; : 1m. 5 _ - = _ 2 parent ofits axference ern jf crested using chile | ___ Sa the previou enmmple we ane able fo crecayibec the» tye of conor hot Ins gatshad fhe event usin s “Name of Conbtd fo identi exactly which Combod is wmised the event but wrth help of Sencler we F cen mot eecess the Nome. property of Grrbokbecacue - il 7 i Chay object can met eccesd chrtol Sau menberde an 98 = Sh we want fo_accem She Hane property efane | _ —conbrh we need p ffrat Convert ender back tt fo “yo the Conbol tung wohich it was created, £0 0 tno : wt Can acceJs “the meme properly aed Benes the exact Confard = “| _DePonth Events = An we axe ouooie every Con bw 4 a | haa nombers df fvents fo 6, one event wit | he itd -defawlt event,.To write code Under defauth | _ = “Event of thak Cobol divectty olouble cArckon | E the combo which takes to 14's mapping event Proc. | r Control: Defaut Event _ Form — - Load | Ls Button ohrck, f ; _ Text for 7 Text thang caf | zn cheelebex ana Rackin Bellon checked chanaecl _ pew After seid Tee TRS List View , ListBox, CombeBox ; = _t and hecke. dtsheox Select dnaer Char geal a Que How _eloed 0 form gels Created 2 — grtee - E Am- Shen a fom fs odded Jp fhe prozect micrially othe following things" dalea place. nod ia [i Creates o efus inbertting. fom the pre clld clos | Form go that the new claw fs also a / ® Sefs gome tibalrzalien propertics | leh Oey Under Halealiiy nm ponen hs — Ley: His» Name = "Ferm" fod tow _cloes a control gets _phececl gn the form? = Am = _vohen_a_confol vs placed on the form 7 followin things dates’ place WAternally: 19 Grealra object of appropriate confog choy. ———, & Cutfon buttonf = new Gutter, bh Texdfox _teetfoxd = new TertBoxQ; _ a Lil Sets some _initialllaadien properties Hearne a ma | stequived ike nome, text che ,Locabior ete a | a 9: baHtont seme = “betlon !™: ee | —_ betta Text = “batlent” 3 \ | buttons. Locations new Poind Cx): - ae i bullont fire = new Size (tofatth, helt); ~ i ty Now ape sans get added -fo_faam = calling | Com bof Add vetted an Current for L |_eg: Asie. Cortrofa Adel Cbuttoh)s - Te Nore? AL the ebove cade will be _genevafed by VS am yes | Uitalew Initfalizadion Com ponent method. ae —_ ~ Uncley a Wirchus apphication cede is of 2 types: a _ = Designer: code ae — fe - Bussiness logic ~ _* |= Code cahith ts se pansi bbe for cemainuction of the — form ls Known a» designereede and exte which us 1 _ Ciespomsble Pov executor of te form jk known w - bussiness egies _ _ _Nele- Designer Code ts genevaded by V vs “under dhe eee ni Halize Component method of | Designers es file | z and busines Lege io Written by programmes sh dhe + 7 _ form of event procs, - - ———— — 200 Se — fh = Befare net 310 designer tode an a iain ic r__} mere _defined_in_g nec in a clear pesct onder a Single - i Freon Foldowing — : a — = = : Before 20° = — LS . ____._Fomices + _ _ _ i C= ie clas Formd 2 Form . _ = Designer Cole eS ee > Gustine Logie 6 ~ from net a0 with Inboduction of parttal cfvied a ; designey code and bussiness Logic wil! sooo ted Linto 2 diffevent frles but of the ame co by a © b FoLlowing = fy, 7 fem _2-0 MS Form}ics g pablic pastial chars farms t Fox o > Bupa Logic 1 F | Permd: designed. cs 5 i poral chars Form t | ee = Beatner Code sia mF =e = = = = — | Cheek Box and Raelio Buttons ~ | These two cenols Gre useol then we oak t fo unex to Sebel frome fret Of avitebse valies. | CheckBex Ts aged then we won) do provicle mult & | sebectfon omel Racl’o Button tx Grcol when We wort _| prow ole séngle Selection, _Nole- Become a Recto Button allows Stnglr Schatite O00 | “select 4 nes conbok autrertaly phe aie ite Pactesete deaf but aaneltme we mas piserl sractie Buttin dha TY [ai Ati oplions , Ap the} ene canbe selected from | + — Beh grep: Fh auch cares we neeol do Pup Me a \ . | Rad's Butt So that One sey be ceketd to each pore - i, | Te Garup Koda bulls we necol do ploce fhem oy seprate tmtaine Like Patnel grwupson fab ov beh tae! and _ spit tmpaitier efc yy Both -the 4wo contro£s _provides @ commen property checkeol to folentify usiuch conbok has been sefectect. in the drat: The property ciefurns, fue If He Control i3 aeteckd or else tt eterna fafse- T Ferme ler ~_ chek tsa ovat — (| acheck Bon. Drocdio Cul bent. / L_ |G check Bona Ovadie Buabionz| t= She ~ -_ [shee] Ee} [see] a _ pee 3 tite] . 8 c Ander First fulton at ip [check Bext chee kecD) oT _ MessageBox shou [” Check Gort ts Selreted"); Sets if (check @oga- checked) fe | Messagefbox. show (" check Box? te selacka Ds © 1 __ Ip Cchecte Borg checked? esl earsears _ MessageBox show (7 check Bex is 5 selected "Dj Aedeaf "nde Secowel Button -+ if. (vedioBeltont. cheek) e Messagetx, Shots ( “cheeitix Radio Bult f ic sobe 72 else if ( godtoguttond « checked) vere Oy MestageBox Show ("Racks Button? is selected); On took tthe if ( siadiogutton3 ch ecka) - e MessageBox Show (“Radro@utton 2 is sefected), eo _ checked Changed Event ~ This is fhe cteParalt teats fir_hoth the above fiwo contof auhich z _tahen_ever the controk is selected! sla de-selected ahd. me IE || Nome [——“] i “otal Fou [ i \ ] -_ Course of fered ———— | CCCs) 1 TvalZo0e) Cy wer Liee) | DOCPP lowe) 0 ASRNet (Ise? DF WPF ( G00) U Os(soow 0 CH lisee) O agzax (3c Track OQ Normal 6 Fast (50) O Sper ait & Fue) 7 _ __|____ Now Ander the. ie ea Of eachcheckRor and Racdbréirtior ; rts aes ae inthe Tag Paoherty of the combo enter We Fees To ure Ahe fexléor ar cr Pasmagrel Fletd erther ret _ the pasword chor property by Sbectiying the chavector a we wan} +o W4e ay a panword charector oF by setting > | the poperiy. use “Syatem Ruwerdchar" as Prue. ie Regishatiowr Foor - - Gueie| a Gee Nes Ca av Fomoord + = =e ‘ ~ 3 | Confirin fod it 5 : | Plone ro: | z ae Addvess : ~ ~ — a ee onloupaere. ( i = __ Set tt “pp a helene Ge = He by borate con He bj the_eonjoofs Using “the Tb key. and the focus moves between the Confoh in the reguence how the condeps anc placed on the Le Porm. If we wank to set the sequence exblieitly on own own Ao Hak ase can navigake according fo 6 i Sst Caer iy ree __ vtequimment to the foslesing: fgets Goto Wo menu > select menu iter border 4 the oy _ which Sova dhe -ament feb sequence of rl boy tlow click om each conbok in which © a wart fo navigate boo the Conteoss. “And ag \ = | wiew mene and ayain select the “ab order cb, In the above form Perfirm the folllos Cerector a.) —_ reetting > check the Usey Nome | Passwere!] CPuod toe boxes do - be tandelory fields LGD Check fled [ePid 4o be tage b/w B-i2 Chavecto rae ti) check (Pwd Matchey uit pure tw) Checks the pame maim Feat box ace pis only Neameric values: [Od Albeo the aners do Cdoge the form if dregs without entering any data. | Riltrecing- Go to the propertita of Pood « AF | To perform €1) fei) and cil) Valyctatiin \ Joeta_and set the ex dength property aa 6 |* Define a Nalidabing event fatcedlioe for vserniar bx and bind po tre Bee po ce chime uohth b + feat boxes alte a | Bud wore jhe following code onder # | ae ar a Tee Pechtox to = sender as Text Box, t If (1. Text [rtm (+ Length = =o) 3 | Menngyebex: shoes (“Cow ned deave Finbty")> I &: andes fue; siefurn y | — 4 If [{bNome f=“ dxtName"D é _ Tf ( tb. tewt-Trier C0 Length <8) t Memage-shoa ( “Rod altel be befucen M6 cher"); €+Concle = hue; re fun} Lip ( tbs Alome ¢ = 5“ betcha”) f if ( tates Text y= te€ (Pod. Tox tt é MenageGoirshoss (“min prod shoul makeh with Parr eseret TJ €) Conche = 4auey a _ \tidoting Event Orcenrg vohen the focus bs peoving the (ontrol to _valtcfate the Content of the Gonpol Some {ven}s Can hawe proper Hes bn dew dhem and If we war} 4s torguine the _preber ts of & event under_on even} event procedure we can cieceys them with the help of Parameler"ey nem PE soe proviclea Access 4p panperttin of “tunvent Exceullty event 2 Concbe is 0 property of Vabidaling event which coher Bet as | 1 _@ fue _orstics the focus ot te leave dhe Conbok f t - T To perfomt the 4 Validation define @ Key Pro even L procecteore pr Phone Pxthex and wate the foils wry Code t i Le t U tenageber shoo ( Convert, Tetniae ( €.Keychar). roo € { If Uchar-tsDigit (@-Keythar ) =- fate 28 c i Convert. Toimia® (é-keythe7) 1=3) Meher); | £ " ~ _ | wt Memageboy.sheo (* Enker Aleumerica onty')- 7 t = = i eMandBed = bees ge | key Pras event ocecna when we pre 2 Key er “white the foam (iy with in the con fink carol L_ the charecter Convetipencling fo the key Peon 5 tnd (6 another property vf Reg fiers de the. key Press fo énter im fo the Text ef 1 phe Fam without Entering daly on the clic! Careke Bullm , do the foltowing- sgn ote paper tee of Conche Buf! coer Vallidabin property 6{ the co bo! thal click event of this ovent oce wis otha _conbtla valideting event. othe Te perform the sth jaa Wf we went di { ' { c i = Keychey ise property of KeyPreus Event hich oct sel ws ruc witt Cancte Rechel | the ey corres Now efick event of the Gallen Concfe wwie she fablacirey | txinome, Comelatidation= fate; thik. chase ts | Actuatly after edick event of the Candle Butte, ValiHeding | evel “Yariteine Teter shoutd 4ce# beck doe bytéon | > Is setting the caures Valtolaition property of the fort box 5 Loo fae orgletcling Fhe texbbors Validadiey venk net 7 | Occur So the Foes comers owt of the Textbox Gud Form. gets clorccl: \ ee = tf { ade Under Cave Bullen - nw {2,1 MessageBox: show (* Data Saved Svecessfelley"}: Ee (ode under Clear Quiten- foreach ( ControA ctol in this.Con ok ) é US (ctd Geet Type QName = = "Fert Gex" ) é : ose Text fer th = ctrl as Ted box: | tb. Cheqe O5 to ig! he 5 fetiane Foca 0} “ Ibag oimboBox., Ltel Box Sis __ a _ a as dees canbe soe ohigsuiah for pout ng Z | the vper to select froma List of aulobte valeres Lb Gomboter _provictes singe sctection only bud gman © Cbiblading | ophtin either te select a value fiom he Ube oF _ veatbon 1 Ener a new value asso sjext box ListBox bydefauf povvictes single sehectim onby bel can be ek nat te] Customized for multiple gelrctin ale fede shir vol The Eee selection mode property of fhe cabot erie: a Matftecters eC | © Multtim ple, ~ re Selection Mocte - a | ¢ Noe _ \ b ~ one (aly - al t —MaltiGckndedd Tcttre Mowedlice 7 | C i : ~ Multisimphe Conky Mowe chick] 7 4 ___cheekedlictBox Is same o& q ListBox but prvien aach en idem asidh a checkbox On -the Lepl side fo A: Anol c \ this tonbuh also provides Mubtisetyedion Gy aefeud! &nby, a P= Adchity Values to thie Con aol - — . | _ we can Add values 4o dhe gbove three Cmbods - Various clipferent styles. € _ “In the properites of Hie embok you « Feit | ft _ “Tens select il and click on he fall See i whieh opens 4 eindoo In which fev ah ch ar 1Of vali te be added in the Cantal aS —— — GD Using Tens ted Mefhed of He co __tne Hert fp the cenbeh each fimes Lompof>. Terms, Adel Cobzecé =n [ai Maley iNembep dell Range method of fhe corkak dou can add mfrvay of ifers af a Hme fo the con tof. | Gaphoring Setueted value from contd} 7+ Thems Add Range | object CF tema) s the “con tist— Th expire the values that axe_selectool florn the Conteh moke use of following property im Combo Box + - - - Text | Stony + = Seller feolsHem chen t . ~ = Celec teal Thaler ine - Usk Go Sefectect Tem object _ = GelacterdTredex int : Sehectealtfems — *beclh OI Selectecltnolecea mt C7 5 __checkeol Cit Bex: eo 3 checked ttems abel oT Cheese Indica int lS — erateckrat iste : Fo sao Selected] Shou Selecta] [slmwo Selected) [County Shotes ces I L 212 $$ «| cen rikok ie Go tothe jew Cafledion property of Comboter chick en _____the button beside tend odd a fbb of Counties i it: Now go to tade view one! write the follwing - 7 EC Under Form tose - ce i Lil@oxAs Temas «Adel (WAP) ~——_i His{Gox 4, Tema sd (7 UPD aa | _=ade viebliple siahes ai ane = , Aoidda, Wek now, Agra | 5 cleo ie How bs Thema . z { om ce 4 > iv fever» — — Under bombofox Sefectoal Index Chengect — 7 | - if ( convert. Tomtz2 (e-Keyther J =< J ere) If | tombe Boyd. Find Shing Exact [ Combe Bor! OL Combo fox. Temas, Aelet ( ComboBor 4 Text) ee ‘" _ - = — { io Under Show Selected ae Button ~ 7 oul Text); Hee ato Unidad Sebechec! It —_— ac Message eRoy. Shows | tombe Box 4, mleaatinda! To.thing ‘3 cL 7 “Under shows Selecteol State Guten - i: a i | foreach (object oby' tin listdoxt Sefectoel Therm) a & i Menage Roy-shoa (obj- Testing UI; = 2 | I L Under shois Selected Crtiea Button | Zz stitng ch = null; Ly ao en | te foreach ( object by In checked Ltée EZ | sk ts obj. ToShing 04" 4” —______.Sh_=_shr- Subtaritg (9, inh tn pts = sire lastdexof (", if (pos) == ; 7 8 sh = chi Remove (pos, 03 ates str. bnsertl pas “and” I; | Menageton Show (8h = i Setectedinderchonged — This fa the olefauttevent of 3 - all the above three Conhpfs ushieh occuws Uohenaer! theavalue is selectecot from dhe Conhvg: x - . a ti _ et - cy |__Sa fo the Flems Cabfeciion properly oF 1s" combo wen oa and add the veders Quartr! , Gunfr2 Quarters, anef ; Guortery. : - as _Declar trey = 2S) Shing (792 =f" dan” "fab" “March” Be a Shing (92 = {SApal”, “rey! Jone G as Shing] ga > fF" Joly" ‘Aus’ ‘sep'F _ Lf shiig fT gy = Ut" nou”, "dec" f : Under énmbotax Selected Index Changed - a . os | Crnbotex2: Them. cleart, agers ee Sultch (lomboos L Sede cted Enclen ) Sots — = y ~ ps) CMe Of = Combo Bor 2. Tema Prd Range: 14125 cope 1: = fom bn hex D . Thema. Add Range (42) 5 _ . = Grete) 2 - . 4 eS ‘ wear —=" Fev Take € __ oirbe Bex 2 Them > Add Range (98) J event of Breaks WA Whenever i : - - | Cope 2: _ ti CombeBor3- Thems. AddRange( 9477: ; A Bret, ee __] \ ? [RRS TS a —j A i | | county [I] i i ae - | t : ‘min | a ; 15 ees, | rE 7 _ at — | Prekote Box = W _- Twagelecation = A _ + Tmage = Tmage. Pom fide (< Path ofthe peng es) | - _ so a ~ _ ) Sreemede s * The Re Gox fs _used fe a -Nermal (a) _alisplaying Tinager ws ~ SteetehImage In an appliention. = Aubosize To ctieplay on iniage vn 2 center Image Ane Pie Bex PF Heimage Should be be sbocinel elt th = fireclsingte Pre tox thing ong of | = none Lo) the arkove poopertiey, } ~ Fixed sd 70) with fhe hebp of Size dw Uaing the Bodestyle ~awedle Peper] of the Cool | properly OP the Gn fro Loe casi, Hinage plewrg and 3 _| we con apectfg hal fepe Gebel Sieing by sett A fof boder the ple@ex Me pmperty _ should have. : - - oN J Wiley comral there axe special Gn bola thal olplays [a — _ | fa ABE Be ek of valuey -te cheme farm use {mie provided there five dialog embek- -~ | Cohiordrabig, folde Brouser Bialag, Faribretog, | OpenFike Diekay rel Sevefrtebiales. Ts hb - | You tout be fyrabiing the liste, Cone onde the os | di fut boy and gnere adele! ono fore oe | -yuu-din see them fn the bettors af fic Studie _ bul tof fiveetly o» fe fom. Jf we coat 16 [the method shoa_diabig of the ce 86 Diy ate. will never _perfornn any ¢ ‘actions + mesponsible tn al’s phe fig sith _axek of = a fo “choose and oretwrns pack ite vale phak prcsesost ected by th Ered Sara App: Developer {Now if ts He Bevebyper $2 Ap: ¥ fey cen fof an _____Caphwe the vo value Ses eee ther gofern a puitabfe erctto pa | Te Caphare the values make use the toll of Pel etth q ___propesti- _ Cpe | _ Color Dialog Cobar folder Broweer dialog Selected ? Ast 5 | ___ Fen Dialog Font tenbok Open Fite Dialog FileName +f and \ Gove file Dialog Fe Tename ~ py - [a aoe _ [eteny eater] Under change Coley & Delesleealt dye tolorDiabot: GhourDraboy (7) , Up “(ay == Dialog Result. ok - t _bulton Back Cofor= tofor Piagdegt. Cob”: _ Under change font Gutter - - : ul | Dialogkesult ob = fon tbiato £. ShowDi'atos 0; tp (dv == Dialog Recull. ok? . | buttona. ent = font ialag 1 Fonts 7 =| Bog \ } | Load Tmage guttm — | gens Under = i ppenfilleDialegt. Filter =" Trng erites Caja) [a ak \ “Bitmap tiles C* rbme) [*ebnp | AM fides O12] *" ae Mls opmfiteDiatogt + Showbictes (2; (dy |= Dialog Result. Cancet) _pichuretoxs » Imegelocation = openPileDialegt ride ttome : Under Save Smaye guthon — |_ SaveFifeDroleg! Filter = “some as above DichygResult oly = savePizeDialagt, Show Dialog: if L dips Oialey Result Cancel) pichimeBorl + Tmage Seve _| Savefrifep falog.t FileName, For % create a menv on a form add _menustip contoR te form uphich sih_om_4op of the form: s 2 Te add_@ menu on menusbip click on Lefthand aide = comoy of a wohich open a feet Box asking ‘fo Fypehere | [Enter a name Pit which adds @ menu ytepeat the | Agme process for ating _oF malt phe Hen er | € | 2 Te Add a meny ihm under a meny clit on the ° j _tmeno uphich epen a_ tert box below asking te dyke “enter elim] | La nome in Ht uahich adds a meno Hem grepeak othe Aume peocent Os | for adeing of multiple meno Fema» “% } [phote-foth Meny 3 Menvitem gre object of the ane Fay c -fookship env item, bit. gs i [? SP we want mena to be mespending of 4 af : | keyboard prefix with "H before He chavecto? phat ey |_| should exrespenl_ few AD a j eg: Beive Gedit Faormakt 7 ry i 7 > To create a shortcut for menu ifern so thot st “evlane) | wresponds to Keyboard acting go te properties of fen item , select sholeuf Key p20 perticg his on (+) Down “i " heside it ashich displays q winolew ry / i c modifier contd Jatt chifl and then ci Z te L: _ fin i Caerbe Bes, hesla ; o mls [Re grep oa F Menu if ~~ L be ae odd sae belween Henv items , to ole Lo Menuttem and Select Insert ~ 5 o—— — adds ap Aparelr pty top ef the M is pole Som we in erfed 4 ~ epareY me can abe =o al Insert a Menutttem sf orequived in the Mrelelle, x a |? df we want to clisploay any image beside menuzsen 1 2 aw onlgPichicts on rt and elect “SetTmage” eotieh opens 1 a. nS [a window, setect Lol Resource and chick on Tmprt | . | butter ahi open 4 clialas tox, uaing ifcelecton | i. Tinege fiom Bard isk ae | - a: = 1 i 2 TS Some times we final check Merk beste prenviterr [ a | fet identify the property ts OOP. t ~ fo £9? Worel wrap Under notepad To create check Mok 4 \ beaile 4 menuttem sight chick on it anol cebect 4 * checkeal™ = t a - Nole- 10 check or OncheK ‘the fem rn eiontime we ! 3 need fo wuk cde ey Pret By vrder pt Dick event of Menudtcm a foltowing. if, ( - checked == bre) Pah i 2 ~ __ceonfwh7, checkeol= false Ei] — ihe 4 Fs _ ‘om bok checked = chug; si = Dock Property Ths’ defines “which barclews of the . a _ eel bound with the Container, A iL can be set citth 6 aiff: Values: = =noe 2 inthis case no boreler of ae cena isboundl with its Container. The Selected bovoler of He contd /'s bound with He dame border of fe Corlainer <= 220 ' i | | = deft Right, top, and golem > Jn this case = “an aho Poldb, peas C Fat- Gn ahs cane “the contrast) bound sw __fowr herders occupreny space of the eomtainer: h Jl the all the avilable emphy get OO opens —t J RiciiTexE Roe This_{s game ay a Textbox bud-provide Capit | advande text enbies and eoliting features ocho dct on chavector ancl paraspaph formatting. The Cnbot + { provieles Abe pet of member Like prop nel! a4 |__tmetfiods for formatting the Text Bike -eul) py] eee peste C2 -SaveFife (shring (path Rich Texl BoxStrem, 'y 2) e __= boadfite(shrng fpath, RichText Bors ream Type) Qt = Ponte Wordtrap , fore odor ect | L _ i _ Memage Box -3 F . ‘ This ts_used For clisplaging mrenages 10 the GIS wer Like _tnfo- ery, warning abet Questo te, pe cick tC To display the MemageBox with a Messeje 2° coll the shoe method that avilable orth oad as fellesing = show (spring ug); Er Show ( Shing mag, sting HEE) } = Show (_ Sting mag, shing tile, Mesmag ebox Getter but - ‘-showlshing moa, sho title, Mere gekex Buttons bul te Menage Box fem fee Lee Dialegheaubt dy = Memage box, Show Tar yor “py stolepd Message Ben buslons Yer 10 Cone te, MowsgeBeor |i = Dials Resutl _[ Mui Noumenintevfatea— | uohide tesigning an application MH con contain A anne number of forma in it “ong hk now to fie 3 oibin deatied form we ane explrettty apecity te | fiom clas name under program choad Gud hen |» we provicle application to Hie cdint we onby - ot _| give Bim the amembdies of the progect that é 7 _ [“Tieade 0 cbini does not have chance fo bole thecfosa pregram and Apecthy the form cata kame Me want to own: - ae "oy » > _To overcome the gbove problem we ase provtetedl i, | with an appyech Known a Meltolocument Thferfecer | a where in this apprech an eppttation Will be having only ene form as a sfertep Porm ovel a __| that 1S cneffereol as MoT parent or Mor Container | 9 Se thal clint olon'€ require fo change the form Fs nome Untcley _prograin claw af ang fine. Rest of te t— _ forma in app. will be under the Confod of Mor Tt __| parent form and vteforred aa MOT Chil» Te lo make ¢ form a Mprfarent get the property \ A. TsMdi (mtetnew ag Tree. ' iS | Woke BE An Applicelin Can Fave only one MoE] parent and all other fois mut be cee ay | of parent which showlol Come anol aft crolee | parents Eq: vs in wMorPoent that Lavechts | Casale all othe forms like “New proyect™ “Add atew tem | vokusl winelous as ifs child. [= — 35) taonch @ Fam a: chilol of porent cmate | objet of chilol Pong clan get ins MBIT Paki worth Parent Poms, Relevence amid hen call Sho contain | jo wie ify the { when woe have more thon ene child firm opened af | t _a time _uncer forent , chit fama will be ovranget ey [ tnaide the porend by wing 2 Layout fox crvongemenp, | t 4 when wits - the can be any of the 4 optiens Like: [ ar 1) Cascacle (ct) 2 chitdl fom, axe amangect® P aus name the other. Z ti) TdeVatcat 2 chit ferme aye amonged £ beicle = 4 & tii) TileHerizen fel! chilol fora one aren geof bel \ gprouicledt “i Anvange Fees ; alk chitol firms fem, ane _anranged _TnterFecer| betlem of Parent “Take a new windows foam Adele menuship Gamboa! oni Land add #00 ytenua fo it forms and Layooks | Under fein menu adel @ acpreke_menv em fear to Loacl+ { fewm) fermi 2 ete.) Undo Lagoa! ead the_amena Thing gnarpe hn cascate fronion tek ond verticak + Tell Usider Each Form $ Meno dtems+ Formi f = new Formi(; fendi Parent = dirs; 1 Fshoot; oe shol er Breangicona at 7 7 rehte i Coaxcede, this iayoat (( Mdilaypext. Anange Cons J; voter! | Uantiedl | (ade J, tite Ver Heal 3; ~Tile Woxizinall D, ————<——+— Timer to tonbol - Tht conbok Tn ion tihibeemiboE series on ever} et | __ygey clefinel tukerval anol _execetes the wde under dhe event when ever |_member of timer contol thy Jteryval » A property using * eohich you can sel the frequenyy forthe event fo ceca ee Event occu, = In milliseconds =P, = iy Tick > This _event occuvs whenever phe or yy specifred Tnherval fine elapses- a = ei UD) StarL—> gts _@ methool te stort phe execution - of the _fimer. 5 a! Ww Slop > Se a method fosfp the execution of mer ” r i Designing an _Jmage Viewer- Bike o new eoineleass a forma * phoce a _ panel and Aef the Dok propot aa_oht, then place ¢ picture box and set Dock “pokey as erll Niwo design the Kel as foldewoiny- Mm: a 2: a ~ Adda folder droue Oialiy and | Hiner Conhols fo fle form » the tp the prperlos of Pre, text and slide shows Guth we

Hstdoxt » Sehected Index sig _ SitnPrev + Enabled = pubes _ bf terl. Enqbfeot = tac, bta.shoe Enabfed = shue s S PnlesUision Sebected Siderthongicl, _. __ Pittane Boxl . Tmage tocation = . olixpoth ¢ “1” 4 UstBoxt coleofed Hem, tng Jvitesc = List Bort: $electedindes » _ S Under Prewou Qubton : - \ “He Limgindeneo) i ie a _ Tf Uy Ungtindes = =o) jf | binPrev. Enabdets false - etl \ eee Ap limgtndes ¢ bistbord «Sena Coan k 4 >. eo 7 vinNext Enabled 2 Thue: 4 - Auster + SdectedInder =_tmg ind we pee YL _ p — - = —|. =) Under Net Bullen s als \plimginder < BsbBort, Temas Count —4) sg g —_ i Vngdndex = tf Limpindec == Tift | Btems, Cour 3. Couns eae ee benilect Enablect = fabe | if Limgtnder bo) “‘WnPrev, Enabled « bye» Histon) | Setected Index = _s'vig Inclex s = se 4 = P e ; be J “Yonder Shale show Buber: = az 2 if (elnshow. Text == “Sroleshow D tte} 4 é oe Binshew Text = “step Show") i i = oe - i ‘ 7 fimerL Interval gnvert To ntsa oombotoul Text J" tooo, | rn _ Hmerd Sort Oz - E - | a p = | \ Shide shout + 7 \ A= - = 3 ——————— ee - i vl Onder Thine Teele Eve: a ° ~ a binmexE. Pex form (hick (9) + { tour Data Source Communi eation = r= a i A_OodoSounce 18 a place coheve siformetiy ts stored which can also be catfecl a3 0 Data - | Storage: we have various types of: Data sources J _ __ for Storing the information Pike Frfes Dafefaaes f — t Tnelexing Seivers ete. . > Programming language an nef speak sith 9 it a | dato Spunce ofirect ecaouse each Data Sov ree ee | | adopts a Ap ferent prrteces for Commy nleakttn 4 4 So Te facitebate the proces of Cammy niesdtion _4 \ ef we have heen pouioled sith the soladitn, a} _-—__| .Minngoft for its coinelnws Mocfines in the forny Lf dat'vers_ond _proviclera: That ait Inthe middie _ [ond tele the epplicadion 4o communicate with _| dota spuvces a TEI ¥ + ta ~ - be Poe fore s +- foals ae . Jreninke | Feet PR ~ : [frites Tn tae oi | —— a - - 2 —t ~ “i __Orivera- These one introduced it! fo provile te | _ ; data Source communication, which exe gga OF of two types: . s (3 TET drivers (Joiat Brgine Technedegy)- fil) coc dyivera (Open DataBase Connectivity )— | WIET Arivers ane designed to cornu: worth j— a tocad data Gases: irke foxpro , tbue | informa ti iS sfc = Data Appi fovierw |_| sources | = re “Dedataia | J ¢ EA T (ii) OOBC Dvivera one clesignest for oremote databace rc Commi nicadtiom- like Oracle , S@LServer etc: sop yce - [exp fox | ~The om cleadtton i ee : Dviveva- Drivers -_ Drivevs “witl be sitting, Bm the 2 form Chint MacRine frat _is the Machine on hi mle application sums became @ driver is not a pe C2 with anappheation, i is 4 seprake gf which Cones Bo afley imfaiting the app» on olint “ _Ypa rut configure bekween the apphtalion « ' and _olaka Sovrces Manually - E c 7 OLEDB providers - (object Unking anol Embedding Noto we pauviderg come in fp _evislance after chivers - dota Sounce Commu why providers in the -the macfline where the datasemce pracht £0 « _the divectly provioling “defal ef the provider con ai paatie fed with the provides vohidh doen't erequired apeciak onfiguretions ‘ Tee — Poth ean ond provicter fave been clevelnped using native Code longuage CC, ct) anal fhey aoe more over pfladeform clepencent. __DalgSounce Cornmunica on Undey Visuak Baie - Lamgusge ~ _ — As Oviveva ard providers Inve been Clevelpef unlay _ | nal ive Code I Coot befween V8 gate ge difvera_and_pibiidl a_i el Sp fae are Frovicket | - with seme_intermeciafe Sihraoy “under VE larg we. _ biter wag _vohich the VB programmer can fath al gig with dyivers anol piovides simplyfying dhe | og \ zi tuk of dommonication a fobloosiny— = ae pao’ Teer _L, | | vil ie oats ts sie wae ai £20 me |e fT + objects) Apols OLEDE Oaka al a gure (abe) fear ° i if 4 [ [ Apo. NET —: Kise Colfectton of Managed Lbrevtes | veed_by net applications for Orta Soorce Commu with the help Of drivers / edovrdterd valet - | te [eave as 4 | er il “trove d —— -aponet ey | 236 - J =o) when «Net wor inbooiaed fo commu. eaith, Dela Source _ { ADDNet mo! lesigned which is extenaton— | te ofder ADO _Conmanaged). my sate V9 apo.ttel prvides ihe Ubsrawey for detaSeorce Gmm } ( _____under the Fellousing Mameopacea- f ped ual Sugtern. Dake: mesge te Syatan. Data Dledbs _proviokeef —____Sgphons Neda. Sqf China j i ic —___Syptcn. ala. OrackecLint 3 ff a _____Sgptern Deka. Obey saerive fe cometin dhe all a - > | ete- Sipiem-Natufofedh(sqekint | bdbe oi = defined vider the same qnembly Sy. lem = em Data, Oracle Chint {1 cleMned | c | under the 1: pace taembly Sypstem D: poe Lt Ovachechints off « Ge AE System Data —: typen under this ame apace axe acol r c Hotding and Monaging of data on chint Nachin c This woyneapace Gmtalns following ger dabreried Oataset, DataTable ,DataRowd , Data Column Commu. | Oataretakion etc. juntca te er. Datebare — Cemmunteate with Sq Serv Sakchint provider. “J 4 | System Data. DrackeCbing= fyb of this mmespace-can | Y purely Cormmunicate with Syf8e Oracle databace = 7 only using OrackeClnt provider a : |_Syplem Dela gabe - types oF this romespace ato | > Can Communieate with ong data Source snaking aM = - a - =f . use of edbe drivers’ i ik ——— _ i — __munie 2 _ ~ AM the above 4 namesPaces confauns sane det A of clawed as Polfowing? Comection Command, OatoReader a fee Gata Mopter. Command Builder, faramefer eh -. cas a ree —+- | tlete- Heve each cfors 1 orefferecl by frefixtng with 2 the'y namespace before closname fo discriminate & ie beluecen Coch offer ay following - i * 4 = OledbGomnection = OkedbComman al | L ji - ~S9hConnection ~ Sqhlornma not Z 2 = Orehe Connection ~ Oracle Corman of | ie = Odbe Gonnec Hom , < Odlbe tommanch a Le =| i I ee 5 a. | Perforrning sperasion ena dakaSevrce= . F. LO perform ony operation on a dataSovrce EE oi a the process envodves of 3 Stepa_ a ihe UW) Exthsa Commection worth Oatasource. \ at ee tity Sending Request as an Sod Statements — 1 a i (iid: Captaring Result andl given by He datasource. | te = Estabfishing a fomection- dn thir pread we- wth open a ehannet for commu: between application “ and_deata gouree thod $s present either on @ - als ms focal ov cemote wackine fo perform any uf | operations, to open the channel Poy Commer | * = ose uae Commection_cllaar + eens or =] Care _ Conxtevctora + _! = rc | _ Gonnec ften : . Connection (hing Connection Shing) > abto a —_Gonnection Shing 1s 0 coflechion of attributes that are Necemary for connecting with q olotaSource tose Ose + provider , DakeSovFce, User td & Pewiord, De 9 bue bY TnifialCatalog and Trusted —Connecte" ov Thhegvateol Securiby and DSN — prides @& déuaned covey prowley te oeged pot Connection with any datasource we aul! Y vinate | different provider for each dafaseurce: a Oracke _Msdaora r _| _ SqfSenver Sh Oheokb ie MS-Aecess or MS - Excel MicxosoFe. i i ~_ ME-Tnelexing Sever’ Meral ke Cf = DakaSource~ dis the name of dare! Machine ; we wart qo commect with This isc, ee the DataSource fs (non a Local wfc: f User Td 8 Pamwoord - as dbls ane secured r _ ___ Storing data to connect with trent youre, | a valid User Nome 2 Pascoorel. i Orache + Scoll PO ewe | Sgfdeivers — Sa/ Lbieatiom | : ere | Os fabase ov Tnitiad Cato fog — Thoe attr poy ~_wahFe tommecting weth cqkserver | hab wewant tosuse the name of fo connect wit _kemizeting with SefServer Enty to specify that Trusted (ommection oy Ttegvaked Security These ofbibute ane also Used hil | We want to use Windows Austen teal _ 7 | Sn this case we shoud net again Wwe ge cL User Id & Pasword attributes _ My _ ' DSN :- Ths othribste 15 waeol while connecting _& with cata sovrce's Using Oslbe diivers a _ fmmection Shing for Oracle = # “provider = Msdaora; Userads Scott j | Camneetion Shing For SqASewer : ‘ger [3 DataSource= Lj DataSource 5 Batabase = Master; Data Sov Sserver name> 75 ¢ Gom-open (2! ces Mapage Boy. show (Cin State. To Shing 0); cm cles | Sending Request as @n Sof Afabement~ = —+Specifying the type of action woe want to pevferm An thie precem uve send ¢ orequest to clade sour, Lusing on Sof Admit: Like Select , Insert , Upoete ! ond” Defeke. To Send and_execute statements Len data _sovyee we use tHe claws Com } covabuctows: t Command { - S Coramand shing_ Command Text, Connection con) Note — Command Text means Select Insert or Update i oy Delle Stmta_ov Sloved Procecue Nome. ___| = CammondText + sels ov gets tHe Setaakemen i Properties of comm and: ~ Comectim ; seta or geld the connection object ampociated with command. Gmociated with command. _ ~>_bbject of chass command can be cxeateel in ony of the following wayas a Cormmand emo = new Command 1) we = cmd) Connection = ) i eric: Commatid Text = “") a oY : aA = [Command cid = new Comnanol (“esq stmt >’ coms | = | Methods of Cemmnanal clone 9 = = = i ——— - EvecuteReadey 2” 2 Data Reaoler | Ereeutesentarcs > Need : aA __Execeutenon Query (2 sim [—_note= Aller creaking object of eat ne teed 4 by elatasoor |__Call any of Anis 3 methods fo execute thas peerform_| = poate Execute Reacler 0 $ fox Select, Cnents Exe ute Sealay J end | c ~ = Call ExeuueReader when we want to cxccuke ~— a_select statements “that “wretuna _clata SWS “on con) anc Colum, The method greferm an object of claus | e__ eader ts which Contains dlaty that tk och? Hoclate __dodasoorce_in_the forma: of pws and soli. re : = Coll ExecuteScalarU method when we want a pelect statement that sielurm a inst youu Object mettod gekvrns the steswtho/ the 9u a form _of an object» - vemeht > Gl ExeadenonOueyy meted tohen we ton € | any att other fhan select pike Insert, updcte, chelate cin etc. The method gieturns 4 value (neumeri Cc +etling the mmber of stows effected by # Note- the elev proces of cafting an appro hy a method te captune the orautta in © i her ceptoring the cresults. | Atcensing data f from a “DataReader- Dake Reader {sa cha» which —bofols decker the form of gems and —columm to acces olde ____|finm dataheader [1 providles the follosing methods 4, GetName ( fat goltndex) > Shiv ~ Reluvns name of the cofumn for given tnolex prs & Readt J > _ book a |= Moves mecorel_poin fer fom fhe _currehd Boot or 7 o—- fo_nerk sow and sretorns o book valke iohth J | \ . | fells uhether phe yoo towhich we Mic moe [a | 4 contains data in iter nol, thet cortt be hue =. wiki if present ov fale ip nef present. ii -———___ + —__+ ma eo 13+ CreWalue Ont coftndec) > object [a B = Used for qefrieulng Colemn vatres fram the 7 J —_| soo t ule #* poln fe’ be Wanting & tee Shecifying me coburn Micferfoss fet 7m Note - we com acoes the pio pomber 49 pointer en the po Ff Bathole kim. la tory also eth by apectFaray humr | vitke pogiton on memes ZPR? [codndex 9 object fc 4 ore ( tofnaimed > object 4 NetReutlO) book . = Moves the neeord pointer fom reat 4 | | ible be pert teste fo bebe criars and |_| metus tie oF eLe meta false. = “| Daing Syatem dake. ofeclb ; ~Depeotnen? Oelack ] = i fobelt - a DecLaralions : Inbe2 = cide QedbCmnecton (an; Takes _mnehheola __ Oledblommand cmd; | OfedbDakageacter ay Under Form Lact: —— 4 Con © new Oftolb Connection (“Prouider= lM : User I= Scott! Pasword= Higer Lohuth cmd = new OfsdbCommond (“select Deptne, Dome. (oc ees From Dept" con ) wise coms Openca: drv=_ cmd Execute Reader); lobels- Text = dr. frekNome (0); Jobula. Text = dy hethame (1); labelg Text = dy Gretnome (2); m “Show Data O i Cay private void Shoedan GO - aur c | & 7 i TE tay Readeay e a textBoxl- Text = dr. GetValue (0): Tost ai | Text bora. Text = dv Cid. testi, pa textbors- Tec = Ar [7 bee]. ToShiy i o Wee _ the = a Mewagebox. shoo (7 last Record J wa ey — 239 Windows Authendeativn 1s more secure Under Next Button: x Show Satac) Under Clare Bation 2 if (ten- Slate 1 = Connectron state. Clore) con. chose co: this. close ¢2° 2 \ Employee Details | - Bo / “| peer ey [eS SS Tiles} Tiel] | [ipa] [oa] - et 4 feud e Dake Reader —: dhs on object thet com hold! ctetal on dint tile oebived from data Sources th ____| the form of Rows and Cols. 2 3 Features of Dale Reader: 1 Faster Access to data fiom the dada Source asit is connechtn Oriented: - lo. Con holel meutipde tables in it ata tme. To (oad ttuttiple tables th to « dade Keater | puss_mudt!ple select stmt a 249) to command Sseprated by Aemi cofen. 240 :- _Gonttand cml = reo Command Select * fom Emp} Select * from Cyfrmes”, ton); Eg Date Reader dr = cmd. Execuk Reader), | _ a Lnole- Use NerHReswlt (3 methed en the Dolafeader object te navigate fiom carent able to ned table Ex- chy. NewéResutt 1 > _Drowbacks of Dale Reader : _ iLits connection Oriented preguivea Cen tinues Can with olale Source _Untidt we access the dete Ao _perfermence gels degvafeol if there are More he. | of clinfa accesing lata al the same hime a. dl gia forward only accers to the « atlows fo go either tO next oecord ox tabse but not ip previow orearol or fobs. hich ewih! n | 3-_ St ts a esread onby object | _any changes fo olata present iin e- Distormected Architecture — i Ano.wet pre _|__atdifferent’ models for qacening elafa f Sovrce- 1 Connection Oriented Archifechure D Dic- Connected Architectire | > Sn the Ploae we greguire @ Confinwous Co | with the dala Source fox accening dala tn i DakoReader chars 1a Uacol fer hotcling ah |_ Machines - where as tin the 9M o, _ocaminyous Conn. with DataSource for ow data here dataset class weel for em clint Machine. — Data Set =: AL is © claw pregent onder Syate ___ Featuses of Dataset —= either topo Bottom Or Gottmte top. sts | dal namespace _dealgned for holobng ane Managing idata_on_efin{ mle apart fiom Date Reader: 1. dts also capasse vf hotoling multe Fables (a. Jtis designed tn olis- connected architecture tohich doen't gtequireal Iny permaneht Connection with clateSource for holcling of fhedada. 3+ Gl provides scyolable navigation to claka thot offfouses -fo meve In anydivechon Hrat a _ Updakeable j.e: changes Can be performed fo f le sca Present nit and alo thoge chengea can be Sent@ack +o Database. ‘= 4+ Doke Present Under this com be filler ad wolf a4 -~ __ sorted alse those changes ores S- dis Supports esteblishing mellow befocery | debheo thet are present oneler ft Ss : LA _ Woking with Dada Set — ae The chs thak 1s wierponribse for Seating °F data into a olateReader from DateSovice ts ¥ “Command , in the same way Dale Adapter sb Fhe [a clays used FoY_emmine nicale between DatoSource | Be ond Oadaget- fie st of ee DofoRe oder < Gommana > “DatoSource | Podaset = DakoAclapter <- > DakaSovrec i | _ _ zs eras | GataAdapter (string siledshnts Connection con 9 [_ DataAdarter (Command crd ) | Ex. Data Adapter a= news Date Adapter (“sefectsint', con), [ Metheds of Date Adapter— = | > Fill ( Dodased ds sting tname ) | > Update (Dataset ds, stung £ name) a eee | = Fill ist Load data fom dalaSource to Oalasel. Update is te feansfer cada fiom a DalaSel to Dal “eB DetaAdepter can infer nelle canfain 4 Commands tnt like: ~ Select Command © Snsert Commend ~ Update Gawmand = Deble Command > when we calt Fret method on Adapter acttony fakes pface inteyn Wy Opens ¢ Connection woth the Dafa Sovice dU Exemte Select Command Under (1 on thon | and Loads data fiom table te Dakaset- Teo Case Me connector. | = Asa Dadasel 5 apdeleable change te data thar rs forded inte it bike adding and debating Secorda- After making all # to defe fm pataset and if we want to send + Changes back to DataSource, cal! Updabe on OalaAdapter which performs folivwi UY Re-opend with tonnectOn wath GU Changes that ane. rade im DalySel Tack te table tahere_in thi poorean iL cot LL ne “ye of Insert, Update and Delete Comments of | DadaAdapter« i UW)-Cloae the cemnection, LT, wah Cen + dhe Data so we can get lode “only 1 @ se guentid Acceming Deda fom Dataset = OadaReacter provictey uw pointer baged access toe Oxdey_where ap “Dotaset provides Ua TrdevB ayes! Acces to the Data so we can get she Deda feony any Slocadion Kandenedy.: Dataset is a Colbicten oF tables where each | table ig tnternably | crepresented wa chs debe Table and tdewstfred by AS index pasion oF Name ax folbpain; 1— Dofasets i ~ Collection Of Tables (data Table) Adekasek P+ Tables [index] or Tables [tot nome! Ex—ds-Ta bles (0) or Tables (emploree "7 JTs stars 4 ia Pps Every DataTable ir again collection af ow@pond Collection of Cofumas tahere each stow 13 infernal srepracnted ax .o claws OsteRoo 244 : i ; rile | | ond each Golumr i sreproented ax «cla Blakcofurn , we can cacoess the olete of a awe by Using ilk er peat asacll a» Aske ofa clumn can be access either ne by Tndey position oY Name: Dole Table: ; = Coblection of Rows ( Date row) datateble>- Rows [ index ds. Tabfes (oJ. Rows oT = Cobfecttion of Columns (Dale Coduma) — cdatateble? Cotumna Findex’] or Colonie ds Tabhes Tod. Cokumna le] oy Cotamnas f ~ Referring fo a Cok Unter DalyTabl: Using System. Dato Sqhthint } Declavetiona : Sqhfonnection Con SqhDadaNclepter da, Sq (ommandBushder eb; Dalaset ds; 2 ynder formaload UJ (on = new SqLlsnnectton [“werid= sa, Dekel _da = new Sofbale Adapter ( “cofect "fom Employ ce Orckr tytno, Ge ds = new Nataset (3: da-Fith (ale “EmploveeJs — DalaGoidView I: SalaSource = (de-Tablea [oH); > Duder Save Buthn CJ cb= new CommmenaBuitder (4a; dla- Update (ols, “ Fmployee'): 3 Under Close batten C) his. chose (9; calaset Dake bage r ja ——— 5 OF —a TF" fe ee ee Le Tur] ) se ay “aM £ Kav plates “chan: ns Made en Grd Vins ‘ae aiveeh —— ‘A echisrrefaeet eh fo bake ag > | To Use OvacteCbint Gamer I we eed fo add the Reference Of | System Nata Oiode(tyntcllt aggem bby EPredefind in Bee} because cea Reference 40 thot sun is mat mi lable in the Proqect notes ue aste_wroxkit iL is nol pomibte bade the | Reference of Ovack Senn: because the «Net frarmeweats n | 40 comes tn_two ophiond~ U) Net fromework4-0 CV .Net Promewerkf | — | 4:0_cinl pofite , the defaull & dint pwfite fb any progedt | . that Is openeel in Vs 2010 ond in 4s Version , we con nok } | Consvme any 3 party fools fike OracteCtnk, os fh e ele To make use of each and every featune of -Nel, we \ e Need ho ist chonge the Target framework of cur fry c | + Nel framework 4:0 (ultimele Version in which al! ¢ ee \> Te chonge the tergel Promeooik of the Prozect 9° éyfno, _| project properties twoindow and under the Com | tengetFrameusork select «Nel Framework 4-0 Oper steference window and AddReference of Sytem De |_anembly under + Net Tab. Tie Lication Configuration mn file a) while developing en application ure we may be hav | wolues it he ap phicalitn that may require changes nH i | Like Company Name , Acddye3 | Phone Mo, Emor£tel Conn. Shy These vabues shoud never _be hard todecl Inthe Sovrc« Became after Installing apphicadiont in dhe clint any changy one orequiree! fn Hee values, Chin i Cowlact the developers, becoume bit can nol a fhe Source code ig nut avilobte fo Ath |r Te menyge AIS siduahken in Readme enviro | the veka, wsh ch wroy grey uiredl chatys th The Fi Tore volves under 4 suai fite Known as Ay Je (app config) 9 _The_ confi fide maintains date drik in xe Format aa L Name, value ov keyValue fairs. Tie values fhabane LMaintoinect Mm the Config Fide Can be acteysee! fn the application al an any time, go while deploying or Tooley in opplicalion on on Splen beth application @ Unf fie get Tnskulbsct seprately so ip He chit wanly an changes fo the values meintalnectin Coifiy file, we ___lean open the Config Fite and changea the values under id 30 trod now when You the App Applicalion reads the Hew = ‘wlton fawn dhe _comfiy fide and uaes tn it, whieh becemas c “ey for developers ax webfas chinks to menage He chnyes T 9 dpa Confty Pte required _under_a progect_,we mush a cither explicitly ade it from the ade nec stem « Gnky a 7 ifde clefauth cones with Tag now & under Fris We can ynaintain Our values that is cc —— nO SIS Sor ened application setting values ar blowing + \ _ Lbenfierabion> Lappset tig > a ae . a aot Key =“ Key-hame’ vabre= “Key-value’ (> 4 Zlappsetting? jen Fagurelion > a _Note-~ Someliwies config fife will be in “Haphicitly aollecl cweker 4 idhe pryect Uke tohen we changes the Taaget Framus ork TT i “tf rh anol I L | of the pwyect4o rf Pt tmphicilby adele you Gan disecily epen it and mainlam Our sgpsetiing under ts Ref Garsor | Type Dynatur is Ree Graor deur dynatur 1] Cager Declavalion, open deur for select * from Bop Fetch date ches Curgor. open deur for select” from Dept fecth dake cle Gnaor 2u/euliz “Comecting with DalaSources Using ODBc ar/vera-_ mec fing wrt ue [ 7 Snoae of eple we we daivers for defosovrce “Communication whereas tacae of oqhclind Ovecke Chint ancl Oleolg we we proviolers for clatasour ce Commraunicaton 7 zm Paoviclers wit be em caver side so an a ppbical or] _ Supplying the clefeiks of pooctiter cling eofth the connectOr details con glort comme. with the DalaSoore arefhy, whereas chivers will be sitting 07 clint mk so te tye them Bl we need to configure the exequivedl river with erequiret Data Source and then From bux App. wing pbc clamen we should Commu. caith obiiverd, al which coiBl ier Commu. WIth dalaSeorces a a Pollowing- Application | Bovider = Detarts en | — Apphicadon od be ry i ae — ) Ais on) = 3 ODEC d Provides. oliff drivers for Connecting wath a i apf Oaladources which comes alrectby under OS i => douse them, swe need to Confrguxc an appro priate | chiver with its target datasource Ay | Sup, Lying) all gequarred Conn Details ,thoterc | stored sien iit _nenecenann Ber | (Data Seyace Nowe). thi's should he specified ie as Orb hike Con frgarnng usith the dyiver: 2500 ‘ - > After Conf quit the DSA we can use Had Osn 1r1 00% set App ko that odbc clawed can talk with the DadeSoore 7 Making use ef-the onver that has been conf (gured, ft | So while creaking Opec tomection clan obfect we ea. nur ee heed Fo Avupphy dsm Name as parameter to Comsfoue for. i a1 following» Odbetonnection con = new Odbelonnection ( | “DSH = __| Configuring a DSN- _2 To Cofigwie a DSN go to slavttenu > Comntro/ hier “Administrative Tools >» Data Sovrces (Oded , olick ont f {2 open * opee Dadq Sourte Administrator? Shoes Fn | tad windows click on Adel Cutten = choose oo) | [ asset dala source Orache SqlServer, Accen, Excel elo. o Lobick Fash, which opens a woindaw iid Aival Mame do the Dsn ond then Supply wregah ol bs [ke User Tol Pad, Paki base, Serves fe finish, which aclels the dsm under epee DataSour AdministraFor woinolow Ont oRokigne? slostre. A / Eom Le Pelotioiak OOP Hil = Table clas A ag & Cobumis i © foo pester ' Lb Recordg : Gebjecls ay SPs > Hethods a _ At ~ oRM( object Relation Mapping ) — ie f sae Redbahiorel — Cop 5 | a 2 Customer , vy < - Cut De PED tnt ue ; ~Ceame Varchay il -_crty Vor char ” c = - Belance money a Select" Pnto Customer from CS1DE--Gy fomex | = a =" | a or a t ou ? = nib ~ aa i | hd |

You might also like