Tài liệu Programming Microsoft SQL Server 2000 with Microsoft Visual Basic .Net - P1 pptx

50 514 0
Tài liệu Programming Microsoft SQL Server 2000 with Microsoft Visual Basic .Net - P1 pptx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Program m ing Micr osoft ® SQL Server™ 2000 with Micr osoft Visual Basic® .NET Foreword Acknow ledgm ent s I ntroduct ion Who’s the Book For? What’s Special About This Book? How’s the Book Organized? Syst em Requirem ent s Sam ple Files Support 1. Get t ing St arted with Visual Basic .NET for SQL Server 2000 Visual St udio .NET, t he Visual Basic .NET I DE An Overview of ADO.NET Capabilit ies A St arter ADO.NET Sam ple Using Query Analyzer 2. Tables and Data Types Chapt er Resources Data Types for Tables Script ing Tables 3. Program m ing Dat a Access wit h T- SQL I ntroduct ion t o Dat a Access w it h T- SQL Aggregat ing and Grouping Rows Processing Dat es Joins and Subqueries 4. Program m ing Views and St ored Procedures I ntroduct ion t o Views Creat ing and Using Views Views for Rem ot e and Het erogeneous Sources I ntroduct ion t o Stored Procedur es Creat ing and Using St ored Procedures Processing St ored Procedure Out puts I nsert ing, Updat ing, and Delet ing Rows Program m ing Condit ional Result Set s 5. Program m ing User - Defined Funct ions and Triggers I ntroduct ion t o User-Defined Functions Creat ing and I nvok ing Scalar UDFs Creat ing and I nvok ing Table- Valued UDFs I ntroduct ion t o Tr iggers Creat ing and Managing Triggers 6. SQL Serv er 2000 XML Funct ionalit y Ov erview of XML Support XML Form at s and Schem as URL Access t o SQL Serv er Tem plat e Access t o SQL Server 7. SQL Serv er 2000 Security Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Ov erview of SQL Server Secu rit y I ntroduct ion t o Special Securit y I ssues Sam ples for Logins and Users Sam ples for Assigning Perm issions 8. Overview of t he .NET Fram ework An I ntroduct ion t o the .NET Fram ework An Overview of ASP.NET XML Web Services 9. Creat ing Windows Applicat ions Get t ing St arted w ith Windows Form s Creat ing and Using Class References I nher it ing Classes Program m ing Event s Except ion Handling for Run-Tim e Err ors 10. Program m ing Windows Solut ions with ADO.NET An Overview of ADO.NET Obj ect s Making Connect ions Working with Com m and and Dat aReader Obj ect s DataAdapt ers , Dat a Set s, Form s, and Form Controls Modifying, I nserting, and Delet ing Rows 11. Program m ing ASP.NET Solutions Review of ASP.NET Design I ssues Creat ing and Running ASP.NET Solut ions Session St at e Managem ent Data on Web Pages Validating the Data on a Web Page 12. Managing XML wit h Visual Basic .NET SQL Server Web Releases Ov erview of XML Technologies Generat ing XML Docum ent s wit h t he .NET Fram ework Dynam ically Set t ing an XML Result Set Th e I nterplay Between XML and Data Sets Creat ing HTML Pages wit h XSLT 13. Creat ing Solut ions wit h XML Web Ser vices Ov erview of Web services A Web Serv ice t o Ret urn a Com put ed Result A Web Serv ice t o Ret urn Values from Tables Th e SQL Server 2000 Web Services Toolk it More on Populat ing Cont rols wit h Web Ser vices About t he Aut hor Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Forew ord During m y five years at Micr osoft, I ’ve been helping developers understand technologies such as Micr osoft Visual St udio, Microsoft SQL Server, and Micr osoft Office Developer. During t he past t wo years, I have w orked on the Microsoft Office XP Visual Basic Language Reference, and now, t he MSDN Office Developer Center. I n the m ont hly colum n on MSDN, Office Talk, I have writ t en art icles to help Office developers understand the .NET plat form and how it affect s t heir current and fut ure developm ent effort s. As I writ e t his foreword to Rick Dobson’s book on program m ing Microsoft SQL Ser ver solutions wit h Microsoft Visual Basic .NET, I think back to m y own experiences developing software applicat ions with Visual Basic. My first experience with Visual Basic was lear ning t he language using version 3.0. I rem em ber picking up m y first Visual Basic beginner’s book and being excit ed as I developed m y first few “ Hello, Wor ld” applications. I couldn’t believe how quick and easy it was t o develop soft ware applicat ions that operat ed sim ilarly t o ot her popular sharew are program s of that t im e. How ev er, during that t im e I also discov er ed som e of t he shortcom ings of Visual Basic as an ent erprise- level developm ent language. I t was then t hat I turned m y at tent ion t o C+ + . I r em em ber being very frustrat ed at t r ying t o learn t he language, trying to underst and concept s such as point ers, m em ory allocat ion, and true obj ect -orient ed program m ing. I t ook classes on C+ + at t he local universit y, but I got even m or e frust rat ed hav ing t o wait m onths unt il I was taught how t o cr eat e t he sim plest Micr osoft Windows form , som et hing I did in j ust a couple of m inut es using Visual Basic. I n m y frust rat ion, I gave up try ing t o learn C+ + and have been using Visual Basic t o develop soft ware applicat ions ever since. As each new v ersion of Visual Basic was released, I readied m yself to learn new soft w are developm ent t echnologies. First it w as Act iveX cont rol developm ent . Then it was calling t he Windows API . Next it was DHTML Applicat ions. Then it w as dat abase developm ent using Micr osoft SQL Ser ver. I t always seem ed as t hough I had to learn a new language and a new developm ent paradigm for ev er y new technology t hat cam e along. I kept t hink ing t hat there had to be an easier and m ore unified appr oach. Well, now we’ve reach ed the advent of the Micr osoft .NET plat form , and wit h it , a revolut ion in the Visual Basic language, Microsoft Visual Basic .NET. I believe t hat Visual Basic .NET will pr ovide software developers wit h new opportunit ies for quick ly and easily designing int egrat ed software applicat ions t hat connect businesses and individuals anyt im e, anywhere, and on virt ually any soft ware device. Wit h advances in t he Visual Basic . NET language, Visual Basic .NET developers w ill finally be on a par wit h t heir C+ + and C# counterparts, participat ing in m any high-end developm ent proj ect s. Wit h Visual St udio .NET feat ures such as cross- language debugging, along wit h Visual Basic .NET conform ance to t he com m on t ype sy st em and t he com m on language runtim e, organizat ions can drive down t heir developm ent cost s by t apping int o t he w ide range of sk ills t hat Visual Basic .NET dev elopers now possess. True obj ect -orient ed program m ing is now available in Visual Basic .NET, including feat ures such as inheritance and m et hod ov er loading. I t ’s now sim pler t o call t he Windows API by using the .NET Fram ework Class Libraries. Web applicat ion developm ent is now as easy as developing Windows form s– based applicat ions. Dat abase application developm ent is m ade easier by unit ing disparat e data obj ect libraries such as DAO, RDO, OLE DB, and ADO under ADO. NET, ut ilizing the power of XML t o consum e and transm it relat ional dat a over com put er net works. And a new t echnology, XML Web services, allows Visual Basic .NET developers t o host t heir soft w are applicat ions’ logic over t he Web. Addit ionally , a big issue for Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. soft w are developers t oday is that of soft war e applicat ion deploym ent and versioning. I f you don’t agree, j ust ask any soft ware developer about “ DLL hell,” and you’re bound t o get an earful. For m any .NET applicat ions, t he .NET plat form feat ures “copy and past e” or XCOPY deploym ent . ( Users sim ply copy y our applicat ion files from the source m edia t o any single directory and run t he applicat ion.) And because .NET no longer relies on the regist ry, virtually all DLL com pat ibilit y issues go away. Wit h t his book, Rick aim s to give you t he skills you need t o pr ogram SQL Server solut ions wit h Visual Basic .NET. I k now you will find Rick’s book helpful. Rick brings his exper ience to bear from t hree previous books: Program m ing Micr osoft Access Version 2002 (Micr osoft Press, 2001), Program m ing Micr osoft Access 2000 (Micr osoft Press, 1999) , and Professional SQL Server Development wit h Access 2000 ( Wrox Pr ess I nc., 2000). Rick also brings his exper ience of leading a successful nat ionw ide sem inar t our. More im portant , I know you w ill enj oy Rick ’s book because of his deep int erest in Visual Basic .NET and SQL Server, and in helping you, t he pr ofessional developer, underst and and apply t hese t echnologies in y our daily soft ware applicat ion developm ent proj ect s. Paul Cornell MSDN Office Dev eloper Center htt p: / / m sdn.m icr osoft.com / officeMicr osoft Corporat ion February 2002 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Acknow ledgm ent s This sect ion offers m e a chance to say t hank you to all who helped m ak e this book possible. I wish t o offer special recognit ion to five support resources. First, the folks at Microsoft Press have been fant ast ic. Dave Clark, an acquisit ions edit or, select ed m e t o writ e t he book j ust m onths aft er I com plet ed anot her book for Microsoft Press. Dick Br own, m y pr oject edit or, staunchly st ood up for his percept ion of how t o m ake t he book’s organization and cont ent clear to you wit hout being pett y or boring t o m e. Dick also light ened m y load subst ant ially by showing a real knack for edit ing m y t ext without dist orting the original int ent . When Dick was especially busy, he handed off som e of his load to Jean Ross, w ho also did an adm irable j ob. Ot hers at Microsoft Press who contribut ed t o m y well- being in one way or anot her include Aaron Lavin and Anne Ham ilt on. Second, I had excellent wor king relat ions wit h several professionals wit hin Micr osoft . Paul Cor nell, a widely know n t echnical editor at Microsoft , was kind enough t o share his insight s on how to present .NET concept s com pellingly. I want t o t hank Paul especially for writ ing the Foreword t o t his book. Kart hik Ravindran served as t he MSXML Bet a Product Lead Engineer at Microsoft Product Support Services during t he t im e t hat I wrot e t his book. He provided valuable technical cont ent about the SQL Server 2000 Web releases. Ot her Microsoft represent atives pr oviding m oral and technical support for t his book include Richard Waym ire and Jan Shanahan. Third, I want t o express m y appreciation t o t he m any readers, sem inar at tendees, and sit e visit ors who took t he t im e t o t ell m e what I did right or wrong for t hem , and also to those w ho shared t heir t echnical support quest ions with m e. I t is t hr ough t his kind of feedback t hat I am able to k now what’s im port ant t o pract icing developers. I encourage you to visit m y m ain Web sit e (ht t p: / / www.program m ingm saccess.com ) and sign t he guest book. The entry for m includes space for you t o leave your evaluat ion of this book or your quest ion about a topic covered in t he book. I prom ise t o do m y best t o r eply personally. I n any event , I definitely read all m essages and use t hem so t hat I can serve you bet t er with future edit ions of this, and ot her, books. Fourt h, I want to t ell the world how grat eful I am to m y w ife, Virginia. Wit hout Virginia’s w arm su pport , love, and care, this book would be less professional. She relieves m e of nearly every r esponsibilit y around t he house w hen I undert ake a book proj ect . I n addit ion, she offers strategic advice on t he issues t o address and their st yle of cov erage. When I run out of t im e, she even pit ches in w it h the proofreading. Fift h, it is im portant for m e to give praise and glory t o m y Lord and Sav ior, Jesus Christ , who I believe gave m e t he st rengt h and wisdom t o w rit e t his book. I n addition, He gave m e healt h during t he long gestat ion period t hat result ed in the birt h of t his book . I t is m y prayer that t he book prove t o be a blessing to y ou. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. I nt roduct ion Any one who buys a book—or considers buying it —w ant s t o k now w ho t he book is for , what sets it apart fr om ot hers like it , and how t he book is organized. Th is introduct ion covers those t hree quest ions, and it also discusses syst em requirem ent s, sam ple files, and support. • Fir st , w h o is t he book for? There are at least t wo answ ers to t his question. One answ er is t hat t he book t argets professional developers (and ot hers aspir ing t o be professional developers) . The second group t he book addresses is those who want to build full- feat ured, secu re SQL Server solutions wit h Visual Basic .NET. • Se con d, w hat ’s special a bou t t h e book? I hope you com e t o believ e that the m ost im portant answ er t o t his quest ion is t hat t he book considered qualit y and depth of coverage m or e im portant t han rushing to m arket . The book will arrive on bookshelves m ore than t hree mont hs aft er the official release of t he .NET Fram ework. I t is m y w ish t hat you deriv e value from t he ext ra t im e t aken to develop t he m any code sam ples and the in-depth discussions of advanced topics, such as class inherit ance, ASP.NET, and XML Web services. • Third, h ow is t h e b ook orga n iz e d? The short answ er is t hat there are two m ain sect ions. One section int roduces SQL Server concept s as it dem onst rat es T- SQL ( Tr ansact SQL) pr ogram m ing techniques. After conv eying SQL Server basic building block s in t he first part, t he second part reveals how t o put t hose parts t ogether w it h Visual Basic .NET and relat ed technologies into SQL Server solut ions for handling com m on dat abase chores. The t hree support item s include a brief descript ion of t he book’s com panion CD and how t o use it , Micr osoft Press Support I nform at ion for t his book, and a sum m ary of syst em and software requirem ent s for t he sam ple code pr esent ed in the book. W ho’s t he Book For ? This book t arget s professional Visual Basic and Visual Basic for Applications developers. From m y sem inar t ours and Web sit es (ht t p: / / www.program m ingm saccess.com and ht t p: / / www.cabinc. net ) , I know that these professionals are driven by a passion t o deliver solut ions to t heir clients through applying t he m ost innovat ive t echnologies their client s will accept . I n-house developers are t he go- t o persons for get t ing result s fast — particularly for cust om in- house sy st em s and dat abases. I ndependent developers specialize in serving niche sit uat ions t hat can include under-served business needs and work ov erflows. I n bot h cases, t hese pr ofessionals need t raining m aterials that addr ess pract ical business requirem ent s while showcasing innovat ive t echnologies without wast ing their t im e. This book strives t o ser ve t his broad need in two specific areas. This book is for developers look ing for code sam ples and st ep-by-st ep inst ruct ions for building SQL Server 2000 solut ions wit h Visual Basic .NET. The book focuses on the int egrat ion of SQL Server 2000 w it h .NET t echnologies tapped v ia Visual Basic .NET. I t is m y firm belief t hat y ou cannot creat e great SQL Ser ver solutions in any program m ing language w it hout knowing SQL Server. Therefore, this book Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. goes beyond traditional coverage of SQL Server for Visual Basic developers. You’ll learn T-SQL program m ing t echniques for dat a access, data m anipulat ion, and dat a definition. A whole chapter equips you t o secur e your SQL Ser ver solutions. I n addit ion, t here’s plenty of cont ent in t his book on Visual Basic .NET and relat ed technologies, such as ADO.NET, ASP.NET, XML ( Extensible Markup Language), and XML Web services. The present at ion of t hese t echnologies dem onstrat es coding t echniques and explor es concepts that equip you t o build bet t er solut ions wit h SQL Server 2000 dat abases. I n addit ion, t he book highlight s innovat ions introduced through t he Web releases for SQL Server 2000 that int egrat e SQL Ser ver 2000 tight ly wit h Visual Basic .NET. This isn’t a book about XML, but t hree of the book ’s 13 chapt ers focus in whole or in part on XML. Therefore, t hose seeking pract ical dem onst rat ions of how t o use XML wit h SQL Server and Visu al Basic .NET w ill derive value fr om t his book. I f you have looked at any of the com puter m agazines over t he past couple of years, you know t hat XML is com ing to a solut ion near you. However, t he rapid pace of XML innovat ion m ay have dissuaded som e from j um ping on t he bandwagon while they w ait t o see what ’s going t o last and w hat ’s j ust a fad. I n t he book’s three chapt ers on XML t echnology, you’ll learn about XML docum ents, fragm ent s, and for m at t ing as w ell as r elat ed t echnologies, such as XPat h ( XML Pat h Language) queries, XSLT ( Ext ensible St ylesheet Language Transform ation), and WSDL ( Web Ser vices Descript ion Language) . W ha t ’s Specia l About This Book? Ther e are sev eral feat ures that m ake t his book st and apart from the flood of books on .NET. One of the m ost im portant of t hese is that t his book didn’t rush t o m arket but rat her shipped m ont hs aft er t he release of t he .NET Fram ework. This allow ed m e enough t im e t o filt er, exam ine, and uncover what w ere t he m ost useful and innovat ive feat ures for Visual Basic .NET developers building SQL Ser ver solutions. For exam ple, the book includes a whole chapt er on creat ing solut ions wit h XML Web services. That chapt er includes two m aj or sect ions on t he SQL Server 2000 Web Services Toolk it , w hich didn’t ship unt il t he day of the .NET Fram ework release. The .NET Fram ework content is at a professional lev el, but it isn’t just for t echies. This book doesn ’t assum e any prior know ledge of t he .NET Fram ework. I t does assum e that you get paid for building solut ions program m atically and that at least som e of those solut ions are for SQL Server dat abases. Therefore, t he book explains basic .NET concept s and dem onst rat es how t o achieve pract ical result s wit h those concept s t hrough a huge collect ion of .NET code sam ples. This book is about building solut ions for SQL Server 2000. I include coverage of the m any special feat ures t hat t ie Visual Basic .NET and SQL Server 2000 closely to one anot her. Alt hough t here is coverage of general .NET database t echniques, this book dives deeply int o T- SQL pr ogram m ing t echniques so that you can creat e your own cu st om dat abase obj ect s, such as t ables, st or ed procedur es, view s, triggers, and user-defined funct ions. I n addit ion, t here is separat e coverage of the XML feat ures released wit h SQL Server 2000 as w ell as separat e coverage of the XML feat ures in t he first t hr ee Web releases t hat shipped for SQL Server 2000. There are num erous code sam ples t hroughout t he book. These will equip you to build solutions wit h Visual Basic .NET, T- SQL, and com binat ions of t he t wo. Finally, t his book is special because of t he unique exper iences of it s author, Rick Dobson. I have trained professional developers in Australia, England, Canada, and t hr oughout t he Unit ed Stat es. This is m y fourt h book in four years, and you can find m y articles in popular publicat ions and Web sit es, such as SQL Server Magazine and MSDN Online. As a Webm aster, m y m ain sit e Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. (ht t p: / / www.program m ingm saccess.com ) serves hundreds of t housands of sessions t o developers each year. I constant ly exam ine t heir viewing habits at t he sit e to det erm ine what int erest s them . I n addit ion, m y site feat ures scores of answers t o t echnical support quest ions subm itt ed by professional developers. My goal in offering answers t o t hese quest ions is t o st ay in touch w it h pract icing developers worldw ide so t hat my new book s address t he needs of pract icing, professional dev elopers. How ’s the Book Orga nized? Ther e are t wo main part s t o t his book t ied t ogether by an int roductory part. Part I I , t he first m ain part, dwells on SQL Server t echniques. Part I I I builds on the SQL Server background as it lays a firm foundat ion in .NET techniques for Visual Basic .NET developers. Part I , t he int roduct ory part, dem onst rates ways t o use SQL Server and Visual Basic .NET t oget her. Part I , I nt r oduct ion Part I , which includes only Chapt er 1, has three m ain goals. Fir st , it acquaints y ou wit h the basics of Visual Basic .NET w it hin Visual St udio .NET. You can t hink of Visual Basic .NET as a m aj or upgrade t o t he Visual Basic 5 or 6 t hat you are probably using current ly. This first sect ion int r oduces som e concept s t hat you w ill find useful as you initially learn t he landscape of Visual Basic .NET. Th e second goal of Chapt er 1 is to introduce ADO.NET. I f you think of Visual Basic .NET as a m ajor upgrade to Visual Basic 6, ADO. NET is m ore like a m aj or overhaul of ADO. I n t wo sect ions, you get an int roduction t o ADO.NET classes— part icularly as t hey relat e t o SQL Server— and y ou get a chance t o see a couple of beginner sam ples of how to create SQL Server solut ions wit h Visual Basic .NET and ADO.NET. Th e third goal of t he int roductory part is to expose you to Query Analyzer . Th is is a SQL Server client tool t hat sh ips wit h all com m ercial edit ions of SQL Server 2000. You can t hink of it as an I DE for T- SQL code. Most of t he book’s first part relies heavily on T- SQL, and t herefore having a conv enient environm ent for debugging and running T- SQL code is helpful. The final sect ion of Chapt er 1 addresses this goal. Part I I , SQL Ser ve r Part I I consist s of six r elat ively sh ort chapt ers that focus subst ant ially on program m ing SQL Server 2000 wit h T- SQL. Chapt er 2 and Chapt er 3 int roduce T- SQL and SQL Serv er dat a t ypes. I f you are going t o program SQL Ser ver and create efficient , fast solut ions, you m ust learn SQL Server dat a t ypes, which is one of t he main point s conveyed by Chapter 2. Many readers w ill grav it ate t o Chapt er 3 because it int roduces core T- SQL pr ogram m ing t echniques for dat a access. You’ll apply the t echniques covered in this chapt er often as you select subsets of rows and colum ns in dat a sources, group and aggregat e row s from a table, pr ocess dat es, and j oin dat a from t wo or m ore t ables. Chapt er 3 also considers special dat a access t opics, such as outer j oins, self joins and subquer ies. The next pair of chapt ers in Part I I , Chapt er 4 and Chapter 5, t ake a look at program m ing database obj ect s t hat you will use for dat a access and dat a m anipulat ion, such as view s, st ored procedures, user- defined funct ions, and triggers. These dat abase obj ect s are im port ant for m any reasons, but one of t he m ost im portant is t hat they bundle T- SQL st at em ent s for t heir easy reuse. I t is Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. widely know n that t he best code is the code t hat you don’t have t o writ e. How ev er, if you do have t o write code, you should definit ely writ e it j ust onc, and then reuse it whenever you need its funct ionalit y. St ored pr ocedures are particu larly desirable dat abase obj ect s because t hey save com piled T- SQL st at em ent s t hat can deliver significant speed advantages over resubm it t ing the sam e T- SQL st atem ent for com pilat ion each t im e y ou want t o perform a dat a access or dat a manipulat ion t ask. Chapt er 4 and Chapt er 5 are also im port ant because t hey convey T- SQL sy nt ax for using param et ers and condit ional logic that support dynam ic r un-t im e behavior and user int eract iv it y. One of t he m ost im port ant feat ures of SQL Server 2000 is it s XML functionalit y. Because XML as a t opic is changing so rapidly, Micr osoft adopt ed a strat egy of upgrading t he SQL Server 2000 XML funct ionalit y through Web releases. Alt hough those with SQL Server 2000 can download t he Web releases without charge from the Microsoft Web sit e, the Web releases are fully supported. Chapt er 6 introduces core XML funct ionalit y int roduced w it h SQL Ser ver 2000 as well as funct ionality from t he fir st t wo Web releases. I n part icular, y ou can learn in t his chapt er about I I S virt ual direct ories as well as form at s for XML docum ent s and schem as. You also learn about tem plat es in virt ual direct ories that facilitat e data access and dat a m anipulat ion t asks over t he Web. Chapt er 7 closes out the SQL Ser ver part of t he book w it h an in-dept h look at program m ing SQL Server security. I n t hese t im es, securit y has grown int o a m onum ent al t opic, and this chapt er can keep you out of t rouble by blocking hackers from getting int o or corrupt ing y our dat abase. You learn such t opics as how t o cr eat e and m anage different t ypes of login and user account s and how t o cont rol t he perm issions available to individual account s as well as groups of account s. By learning how t o script account s and perm issions with T- SQL, you sim plify revising and updat ing security as condit ions ch ange ( for exam ple, when users leave t he com pany or when new, sensit ive dat a gets added t o a t able) . Part I I I , .N ET Chapt er 8 st arts t he .NET part of t he book w it h a review of select ed .NET t opics that ar e covered in the initial look Chapt er 1 offered at t he .NET Fram ewor k. This chapt er prov ides an overview of t he archit ect ur e for .NET solut ions, and it drills down on t wo topics: ASP.NET and XML Web services. The general purpose of this chapt er is t he sam e as Chapt er 1 , w hich is to introduce concept s. The em phasis in Chapt er 8 isn’t how you do som et hing, but rather what are t he m aj or technologies enabling you t o do som ething. Chapt er 1 and Chapter 8 are bot h relat ively sh ort chapt ers, but you m ay find them invaluable if y ou are t he k ind of person who benefits from high-level overviews of a collect ion of t opics. Chapt er 9 st arts w ith a close exam inat ion of how to use Windows Form s wit h Visual Basic .NET. I t t hen sh ift s its focus to a review of t raditional class processing concept s via Visual Basic .NET as an int r oduct ion t o class inherit ance, a new obj ect -orient ed feat ure t hat mak es it s first appearance in Visual Basic wit h Visual Basic .NET. Next t he t r eat m ent of classes progresses to t he handling of built - in event s as well as the raising of cust om event s. Finally the chapt er closes wit h an exam inat ion of the new exception handling techniques for processing run- tim e errors. Chapt er 10 is a how - t o guide for solutions t o t y pical problem s wit h ADO.NET. Before launching into it s progression of sam ples show ing how to perform all k inds of task s, t he chapt er st arts with an ov er view of the ADO.NET object m odel that covers t he main obj ect s along wit h select ed propert ies and m et hods for each obj ect . The how- t o guide focuses on dat a access t asks, such as select ing rows and colum ns from SQL Ser ver database obj ect s, as well as data m anipulat ion tasks, such as insert ing, updat ing, and delet ing rows in a table. Working t hr ough Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. [...]... eloper Edit ion of Visual St udio NET, w hich includes Visual Basic NET To use t his book, y ou’ll need t o have Visual Basic NET or Visual St udio NET inst alled on your com put er ( See Chapt er 1 for m or e inform at ion on v ersions of Visual Basic NET and Visual St udio NET.) I n addit ion, y ou’ll need SQL Serv er 2000, and for som e of t he chapt ers, you’ll need SQL Serv er 2000 updat ed wit... Analyzer w ill help y ou t o easily and quick ly debug y our T- SQL code Alt hough y ou can pr ogram and debug T- SQL dir ect ly w it h Visual Basic NET and ADO.NET, Query Analyzer prov ides a m uch r icher env ironm ent t hat m akes y our T- SQL coding go m uch fast er Ev en if an applicat ion calls for r unning T- SQL inside of a Visual Basic NET applicat ion, I oft en find it convenient t o debug... nam es for t he SQL Ser ver NET dat a prov ider classes for int eract ing wit h SQL Server inst ances are SqlConnect ion, SqlCom m and, SqlDat aReader, and SqlDat aAdapt er You can use t he SqlDat aReader class for read- only applicat ions fr om a SQL Serv er dat a source Two especially convenient ways t o display r esult s w it h a SqlDat aReader class are in a m essage box or t he Visual St udio NET... can be a T- SQL dat a access st at em ent , such as SELECT * FROM MyTable The second SqlCom m and argum ent designat es t he source connect ion for t he T- SQL st at em ent For exam ple, y ou can use t he nam e of a SqlConnect ion obj ect , such as My SQLCnn1 Figur e 1- 3 shows t he rout e fr om a SQL Serv er dat a source t o a SqlDat aReader obj ect Alt hough t he SqlConnect ion and SqlCom m and... eloping solut ions wit h Visual Basic NET Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark Visual Basic NET is available as part of Visual St udio NET in four edit ions: • • • • Professional Ent erpr ise Dev eloper Ent erpr ise Archit ect Academ ic All four edit ions of Visual St udio NET include Visual Basic NET, Micr osoft Visual C# NET, Microsoft Visual C+ + NET, and support... is about building applicat ions for SQL Ser ver 2000 This focus j ust ifies in- dept h coverage of SQL Serv er program m ing t opics— in part icular, T- SQL, Micr osoft ’s ext ension of t he St ruct ured Query Language ( SQL) Third, t he book illust rat es how t o pr ogr am in Visual Basic NET, but w it h part icular em phasis on dat abase issues for SQL Ser ver 2000 Special at t ent ion goes t o relat... of pr ofessional Visual Basic developers hav e no hands- on fam iliarit y wit h Visual Basic NET and it s relat ed t echnologies I f you already knew Visual Basic NET, it wouldn’t m ake any sense t o buy a book describing how t o use it This chapt er t herefore focuses on how t o get st art ed wit h Visual Basic NET and one of it s cor e r elat ed t echnologies for t hose building SQL Ser ver applicat... t hem t o Microsoft Pr ess via e- m ail t o: m spinput @m icrosoft com Or v ia post al m ail t o: Micr osoft Pr ess At t n: Pr ogram m ing Micr osoft SQL Ser ver 2000 w it h Microsoft Visual Basic NET Edit or One Microsoft Way Redm ond, WA 9805 2- 6399 Please not e t hat product support is not offer ed t hr ough t he above m ail address For product support inform at ion, please visit t he Microsoft. .. s support t wo- way int eract ion w it h a dat a source, t he SqlDat aReader obj ect allows read- only access t o t he result set from t he T- SQL st at em ent ser v ing as an argum ent for a SqlCom m and const r uct or Because a SqlDat aReader obj ect cannot specify it s ow n dat a source, a SqlDat aReader obj ect m ust link t o a SqlConnect ion obj ect t hr ough an int erm ediat e SqlCom m and obj... her languages I n addit ion, Microsoft offer s Visual Basic NET St andard, w hich doesn’t include Visual C# NET or Visual C+ + NET Because t his book t arget s professional Visual Basic dev elopers creat ing SQL Ser ver applicat ions, it uses t he Ent erpr ise Developer Edit ion of Visual St udio NET You m ay not ice som e differ ences if y ou’r e using anot her edit ion Visual St udio NET can be inst . arted with Visual Basic .NET for SQL Server 2000 Visual St udio .NET, t he Visual Basic .NET I DE An Overview of ADO .NET Capabilit ies A St arter ADO .NET. st ep-by-st ep inst ruct ions for building SQL Server 2000 solut ions wit h Visual Basic .NET. The book focuses on the int egrat ion of SQL Server 2000

Ngày đăng: 24/12/2013, 02:18

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan