Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edition Edition Rick Dobson - Download the full ebook now to never miss any detail
Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET 1st edition Edition Rick Dobson - Download the full ebook now to never miss any detail
https://ebookultra.com/download/programming-microsoft-visual-basic-
net-version-2003-francesco-balena/
https://ebookultra.com/download/programming-with-microsoft-visual-
basic-2012-6th-edition-diane-zak/
https://ebookultra.com/download/microsoft-sql-server-2012-t-sql-1st-
edition-tom-coffing/
https://ebookultra.com/download/sams-teach-yourself-microsoft-sql-
server-2000-in-21-days-2nd-edition-richard-waymire/
Microsoft SQL Server 2008 Administration with Windows
PowerShell 1st Edition Ananthakumar Muthusamy
https://ebookultra.com/download/microsoft-sql-
server-2008-administration-with-windows-powershell-1st-edition-
ananthakumar-muthusamy/
Programming the Web with Visual Basic NET 1st Edition Lynn
Torkelson
https://ebookultra.com/download/programming-the-web-with-visual-basic-
net-1st-edition-lynn-torkelson/
https://ebookultra.com/download/inside-microsoft-sql-
server-2008-t-sql-querying-1st-edition-itzik-ben-gan/
https://ebookultra.com/download/mastering-microsoft-visual-
basic-2008-evangelos-petroutsos/
Foreword
I nt roduct ion
Who’s t he Book For?
What ’s Special About This Book?
How’s t he Book Organized?
Syst em Requirem ent s
Sam ple Files
Support
1. Get t ing St art ed w it h Visual Basic .NET for SQL Serv er 2000
Visual St udio .NET, t he Visual Basic .NET I DE
An Overv iew of ADO.NET Capabilit ies
A St art er ADO.NET Sam ple
Using Query Analyzer
13. Cr eat ing Solut ions wit h XML Web Ser v ices
Overv iew of Web ser v ices
A Web Serv ice t o Ret ur n a Com put ed Result
A Web Serv ice t o Ret ur n Values from Tables
The SQL Ser ver 2000 Web Ser v ices Toolk it
Mor e on Populat ing Cont rols wit h Web Ser vices
The t hr ee support it em s include a br ief descr ipt ion of t he book’s com panion CD
and how t o use it , Micr osoft Pr ess Support I nfor m at ion for t his book, and a
sum m ary of syst em and soft war e requirem ent s for t he sam ple code pr esent ed in
t he book.
H ow ’s t h e Book Or ga n ized?
Ther e ar e t wo m ain part s t o t his book t ied t oget her by an int roduct ory part . Part
I I , t he first m ain part , dwells on SQL Ser ver t echniques. Part I I I builds on t he
SQL Ser ver background as it lays a firm foundat ion in .NET t echniques for Visual
Basic .NET dev elopers. Part I , t he int r oduct ory part , dem onst rat es way s t o use
SQL Ser ver and Visual Basic .NET t oget her.
Pa r t I , I nt r odu ct ion
Part I , w hich includes only Chapt er 1, has t hree m ain goals. First , it acquaint s y ou
wit h t he 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 cur rent ly . This first sect ion int r oduces som e concept s t hat you w ill
find useful as y ou init ially learn t he landscape of Visual Basic .NET. The second
goal of Chapt er 1 is t o int r oduce ADO.NET. I f y ou t hink of Visual Basic .NET as a
m aj or upgrade t o Visual Basic 6, ADO. NET is m or e lik e a m aj or overhaul of ADO.
I n t wo sect ions, you get an int roduct ion t o ADO.NET classes— part icular ly as t hey
relat e t o SQL Serv er— and y ou get a chance t o see a couple of beginner sam ples
of how t o creat e SQL Serv er solut ions w it h Visual Basic .NET and ADO.NET. The
t hird goal of t he int roduct ory part is t o ex pose y ou t o Query Analy zer . This is a
SQL Ser ver client t ool t hat ships w it h all com m ercial edit ions of SQL Ser ver 2000.
You can t hink of it as an I DE for T- SQL code. Most of t he book’s first par t relies
heav ily on T- SQL, and t her efor e hav ing a conv enient env ir onm ent for debugging
and running T- SQL code is helpful. The final sect ion of Chapt er 1 addresses t his
goal.
Pa r t I I , SQL Se r v e r
Part I I consist s of six r elat iv ely short chapt ers t hat focus subst ant ially on
program m ing SQL Serv er 2000 w it h T- SQL. Chapt er 2 and Chapt er 3 int r oduce T-
SQL and SQL Serv er dat a t ypes. I f y ou ar e going t o program SQL Ser ver and
creat e efficient , fast solut ions, y ou m ust lear n SQL Ser ver dat a t ypes, which is
one of t he m ain point s conveyed by Chapt er 2. Many r eaders w ill grav it at e t o
Chapt er 3 because it int roduces cor e T- SQL pr ogram m ing t echniques for dat a
access. You’ll apply t he t echniques covered in t his chapt er oft en as y ou select
subset s of r ows and colum ns in dat a sources, group and aggregat e row s from a
t able, pr ocess dat es, and j oin dat a fr om t w o or m or e t ables. Chapt er 3 also
considers special dat a access t opics, such as out er j oins, self j oins and
subquer ies.
The next pair of chapt er s in Part I I , Chapt er 4 and Chapt er 5, t ak e a look at
program m ing dat abase obj ect s t hat you w ill use for dat a access and dat a
m anipulat ion, such as v iews, st ored procedures, user - defined funct ions, and
t riggers. These dat abase obj ect s are im port ant for m any reasons, but one of t he
m ost im port ant is t hat t hey bundle T- SQL st at em ent s for t heir easy r euse. I t is
widely k now n t hat t he best code is t he code t hat you don’t hav e t o wr it e.
Howev er, if y ou do have t o w rit e code, y ou should definit ely wr it e it j ust onc, and
t hen reuse it w henev er you need it s funct ionalit y. St or ed pr ocedur es are
part icular ly desirable dat abase obj ect s because t hey save com piled T- SQL
st at em ent s t hat can deliv er significant speed advant ages ov er r esubm it t ing t he
sam e T- SQL st at em ent for com pilat ion each t im e y ou want t o perform a dat a
access or dat a m anipulat ion t ask. Chapt er 4 and Chapt er 5 ar e also im port ant
because t hey conv ey T- SQL sy nt ax for using param et ers and condit ional logic
t hat support dy nam ic r un- t im e behav ior and user int eract iv it y.
One of t he m ost im port ant feat ur es of SQL Ser ver 2000 is it s XML funct ionalit y .
Because XML as a t opic is changing so rapidly, Micr osoft adopt ed a st rat egy of
upgrading t he SQL Serv er 2000 XML funct ionalit y t hrough Web releases. Alt hough
t hose w it h SQL Serv er 2000 can dow nload t he Web releases w it hout charge from
t he Microsoft Web sit e, t he Web r eleases ar e fully support ed. Chapt er 6
int r oduces core XML funct ionalit y int roduced w it h SQL Ser ver 2000 as w ell as
funct ionalit y fr om t he fir st t wo Web r eleases. I n part icular, y ou can learn in t his
chapt er about I I S v irt ual direct ories as well as form at s for XML docum ent s and
schem as. You also learn about t em plat es in virt ual dir ect or ies t hat facilit at e dat a
access and dat a m anipulat ion t asks over t he Web.
Chapt er 7 closes out t he SQL Ser ver part of t he book w it h an in- dept h look at
program m ing SQL Serv er secur it y . I n t hese t im es, secur it y has grown int o a
m onum ent al t opic, and t his chapt er can k eep y ou out of t rouble by blocking
hackers from get t ing int o or corr upt ing y our dat abase. You learn such t opics as
how t o creat e and m anage differ ent t y pes of login and user account s and how t o
cont r ol t he perm issions available t o indiv idual account s as well as gr oups of
account s. By learning how t o script account s and perm issions w it h T- SQL, y ou
sim plify r ev ising and updat ing secur it y as condit ions change ( for exam ple, w hen
users leav e t he com pany or w hen new , sensit iv e dat a get s added t o a t able) .
Pa r t I I I , .N ET
Syst e m Re qu ir e m en t s
The requir em ent s for t his book var y by chapt er. I developed and t est ed all
sam ples t hroughout t his book on a com put er equipped wit h Windows 2000
Ser ver, SQL Serv er Ent erprise Edit ion, and t he Ent erprise Dev 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 h Web r eleases 1, 2, and 3. Chapt er 6
giv es t he URLs for downloading Web r eleases 1 and 2. Chapt er 12 giv es t wo
different URLs for downloading Web Release 3— one w it h t he SQL Serv er 2000
Web Ser v ices Toolk it and t he ot her wit hout it .
For select ed chapt ers, y ou can run t he sam ples wit h less soft ware or different
operat ing syst em s t han t he one t hat I used. For exam ple, chapt ers 2 t hrough 5
will run on any operat ing syst em t hat support s a com m ercial version of SQL
Ser ver 2000, such as Windows 98 or a m or e recent Windows operat ing syst em .
Chapt er 7 r equires an operat ing syst em t hat support s Windows NT secur it y , such
as Windows 2000 or Windows XP Professional. Chapt er 6, Chapt er 11, and
Ch a pt e r 1 3 r equir e Microsoft I nt ernet I nform at ion Serv ices ( I I S) . I n addit ion,
Chapt er 6 r equires t he inst allat ion of Web r eleases 1 and 2. For Chapt er 11, your
syst em needs t o m eet t he m inim um requirem ent s for ASP.NET. ( See a not e in t he
“How Does ASP.NET Relat e t o ASP?” sect ion of Chapt er 8.) Several of t he
sam ples in Ch ap t er 1 3 require Web Release 3 and it s associat ed SQL Ser ver
2000 Web Serv ices Toolkit .
Sa m ple File s
Sam ple files for t his book can be found at t he Microsoft Press Web sit e, at
ht t p: / / www .m icrosoft .com / m spress/ books/ 5792.asp. Click ing t he Com panion
Cont ent link t ak es you t o a page fr om w hich y ou can dow nload t he sam ples.
Supplem ent al cont ent files for t his book can also be found on t he book’s
com panion CD. To access t hose files, insert t he com panion CD int o y our
com put er’s CD- ROM dr ive and m ake a select ion fr om t he m enu t hat appears. I f
t he Aut oRun feat ure isn’t enabled on y our sy st em ( if a m enu doesn’t appear when
you insert t he disc in y our com put er ’s CD- ROM drive) , r un St art CD.ex e in t he r oot
folder of t he com panion CD. I nst alling t he sam ple files on y our hard disk requir es
approx im at ely 15.3 MB of disk space. I f y ou have t rouble r unning any of t hese
files, r efer t o t he t ext in t he book t hat describes t hese pr ogr am s.
Aside from t he sam ple files t hat t his book discusses, t he book ’s supplem ent al
cont ent includes a st and- alone eBook inst allat ion t hat w ill allow y ou t o access an
elect ronic v ersion of t he pr int book direct ly from your deskt op.
Su ppor t
Ev er y effort has been m ade t o ensure t he accur acy of t his book and t he cont ent s
of t he com panion CD. Microsoft Press pr ov ides cor rect ions for books t hr ough t he
World Wide Web at t he follow ing address:
ht t p: / / www .m icrosoft .com / m spress/ support
To connect dir ect ly t o t he Micr osoft Pr ess Know ledge Base and ent er a query
regarding a quest ion or an issue t hat you m ay have, go t o:
ht t p: / / www .m icrosoft .com / m spress/ support / search.asp
I f you have com m ent s, quest ions, or ideas r egarding t his book or t he com panion
cont ent , or quest ions t hat are not answered by query ing t he Know ledge Base,
please send 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 98052- 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 Support Web sit e at :
ht t p: / / support .m icr osoft .com
Cha pt e r 1 . Ge t t ing St a r t e d w it h Visua l
Ba sic .N ET for SQL Se r v e r 2 0 0 0
This book aim s t o giv e professional dev elopers t he background t hat t hey need t o
program SQL Ser ver applicat ions w it h Micr osoft Visual Basic .NET. This ov erall
goal im plies t hree guidelines:
• First , t he book t arget s pract icing dev elopers. I n m y exper ience, t hese ar e
busy pr ofessionals who need t he det ails fast . These indiv iduals alr eady
know how t o build applicat ions. They buy a book t o lear n how t o build
t hose applicat ions wit h a specific set of t ools.
• Second, t he book 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 ed .NET t echnologies, such as t he .NET Fram ew ork,
ADO.NET, ASP.NET, and XML Web ser vices.
• 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 for ot 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 alled on com put ers r unning one of five operat ing
syst em s: Windows 2000, Windows NT, Window s XP, Windows ME, and Windows
98. Not all t he .NET Fram ework feat ures are av ailable for each operat ing syst em .
For exam ple, Windows 98, Windows Me, and Windows NT don’t support
dev eloping ASP.NET Web applicat ions or XML Web serv ices applicat ions. The
sam ples for t his book ar e t est ed on a com put er running Windows 2000 Ser ver,
which does support all .NET Fram ew or k feat ur es.
To open Visual St udio .NET, click t he St art but t on on t he Windows t ask bar,
choose Program s, and t hen choose Micr osoft Visual St udio .NET. Visual St udio
displays it s int egrat ed dev elopm ent env ironm ent , including t he St art Page ( unless
you prev iously configur ed Visual St udio t o open different ly ) . Fr om t he St art Page,
you can configure Visual St udio t o w ork according t o y our dev elopm ent
preferences, and y ou can st art new solut ions as well as open ex ist ing pr oj ect s.
Use t he links on t he left side of t he St art Page t o begin configur ing Visual St udio
.NET for developing solut ions in Visual Basic .NET. Click t he My Pr ofile link t o
open a pane in w hich you can specify an overall profile as w ell as indiv idually
indicat e y our preferences for Keyboard Schem e, Window Lay out , and Help Filt er.
You also can designat e t he init ial page t hat Visual Basic .NET displays. When y ou
are beginning, it m ay be part icular ly conv enient t o choose Show St art Page. As a
Visual Basic dev eloper who has work ed w it h Visual Basic 6, y ou m ight feel m ost
fam iliar w it h a lay out t hat reflect s y our pr ior developm ent env ir onm ent . Figure 1-
1 shows t hese My Pr ofile select ions.
Aft er set t ing your pr ofile, you can r et urn t o t he init ial St art Page pane by
choosing t he Get St art ed link from t he m enu on t he left border. I f you had
creat ed pr ev ious solut ions, t he last four m odified proj ect s would appear on t he
Proj ect s t ab of t he St art Page. The t ab shows pr oj ect nam es along w it h dat e last
m odified. I f a pr oj ect y ou want t o v iew doesn’t appear on t he list , you can click
t he Open Proj ect link t o display t he Open Proj ect dialog box and t hen navigat e t o
a direct ory cont aining t he pr ev iously cr eat ed solut ion. Select t he proj ect ’s folder
t hat y ou want t o open in t he I DE, and double- click t he solut ion file ( .sln) for t he
proj ect . The next sect ion illust rat es t his pr ocess in t he cont ext of a sam ple
proj ect .
To cr eat e a new solut ion, click t he New Pr oj ect link t o open t he New Pr oj ect
dialog box . I f y ou saved prefer ences such as t hose show n in Figure 1- 1, t he
dialog w ill aut om at ically select Visual Basic Proj ect s in t he Proj ect Types pane of
t he New Proj ect dialog box. On t he r ight , y ou can select a t em plat e for launching
a proj ect . Table 1- 1 shows t he pr oj ect t em plat e nam es along w it h a br ief
descript ion av ailable from t he Ent erpr ise Dev eloper Edit ion of Visual St udio .NET.
Choosing a t em plat e ( by clicking OK aft er select ing a t em plat e) opens a proj ect
ready for creat ing t he t ype of solut ion t hat y ou want t o dev elop. When Visual
St udio .NET sav es t he t em plat e t o st art a new proj ect , it specifies eit her a file
folder or a Web sit e for t he t em plat e’s files; y ou can overr ide t he default nam es
for t he file folder and Web sit e.
N ot e
Not all t he pr oj ect t em plat e t ypes in Table 1- 1 are available
wit h t he non- Ent er prise ( or St andard) edit ions of Visual
St udio .NET. I n addit ion t o t he em pt y proj ect s, t he St andar d
edit ions m ak e available t he Windows Applicat ion, ASP.NET
Web Applicat ion, ASP.NET Web Serv ice, and Console
Applicat ion t em plat es.
7DEOH9LVXDO%DVLF1(73URMHFW7HPSODWH7\SHV
7HPSODWH1DPH &UHDWHV$
Windows Windows applicat ion w it h a form
Applicat ion
Class Library Windows applicat ion suit able for a library of classes wit hout a
for m
Windows Cont r ol Proj ect for dev eloping cust om reusable form cont r ols for
Librar y Windows applicat ions
ASP.NET Web Web applicat ion on a Web server
Applicat ion
ASP.NET Web XML Web serv ice on a Web serv er
Ser vice
Web Cont r ol Librar y Proj ect for dev eloping cust om reusable cont r ols for Web
applicat ions
Console Applicat ion Com m and line applicat ion t hat operat es in an MS- DOS–st y le
window ( t he Console)
Windows Serv ice Windows serv ice, form erly NT serv ice, applicat ion t hat runs
in t he background w it hout it s ow n cust om user int erface
Em pt y Pr oj ect Local pr oj ect wit h no cust om st yle
Em pt y Web Pr oj ect Web proj ect wit h no cust om st yle
New Pr oj ect I n Blank proj ect in an ex ist ing folder
Ex ist ing Folder
Ther e ar e t wo m ain cat egor ies of t em plat es: Web pr oj ect s and local proj ect s. Web
proj ect s perm it a browser t o serv e as t he client for a proj ect . Web pr oj ect s are
opt im ized for form processing on t he Web ser v er . Local pr oj ect s offer cust om
for m user int erfaces wit h t he capabilit y of processing on a local w orkst at ion. Local
proj ect s can pr ov ide richer env ir onm ent s m or e conduciv e t o client - side
program m ing, but local proj ect s don’t offer t he wide accessibilit y of solut ions
running fr om a Web ser ver.
When y ou select a Console Applicat ion t em plat e and click OK t o launch a new
proj ect , Visual St udio .NET r esponds by opening a pr oj ect w it h a blank m odule. I n
addit ion t o t he Module window, Visual St udio displays Solut ion Explorer and t he
Propert ies w indow. You can ent er code dir ect ly int o t he Module w indow, which
appears as a t ab t hat y ou can select alt er nat ely w it h t he St art Page. Figur e 1- 2
shows a code sam ple in t he Main subrout ine t hat prom pt s for a first and second
nam e before com bining t hem and display ing t hem in t he Console ( t he com put er’s
m onit or ) . The code is also available as MyNam eI sFrom Console in t he Chapt er 1
folder on t he com panion CD for t his book . Alt hough Visual Basic dev elopers didn’t
prev iously have Console applicat ions rout inely available, t his sam ple should be
very easy t o follow. The final t w o lines present an inst ruct ion and cause t he
window t o r em ain open unt il t he user responds t o t he inst ruct ion. This allows t he
user t o v iew t he full nam e in t he Console w indow.
.N ET D a t a Pr ovide r Type s
Your .NET Fram ework solut ions requir e .NET dat a providers t o connect t o dat a
sources. These pr ov iders are differ ent fr om t hose used wit h ADO, but t her e are
dist inct sim ilar it ies in som e of t he ways y ou use t hem . Wit h .NET dat a prov iders,
your solut ions can connect , r ead, and ex ecut e com m ands against dat a sources.
The .NET prov iders also offer select ed ot her funct ions, such as t he m anagem ent
of input and out put par am et ers, securit y, t ransact ions, and dat abase ser ver
errors.
Visual St udio .NET ships wit h t wo .NET dat a providers— t he SQL Serv er .NET dat a
prov ider and t he OLE DB .NET dat a pr ov ider. I n addit ion, y ou can dow nload an
ODBC .NET dat a prov ider fr om t he Micr osoft MSDN dow nload sit e
( ht t p: / / m sdn.m icr osoft .com / downloads/ default .asp) .
N ot e
As I writ e t his chapt er , t he ODBC .NET dat a pr ov ider j ust becam e
av ailable wit h t he r ollout of t he shipping version of Visual St udio
.NET. You can download it fr om
ht t p: / / m sdn.m icrosoft .com / downloads/ default .asp?url= / downloads/ s
am ple.asp?url= / m sdn- files/ 027/ 001/ 668/ m sdncom posit edoc.x m l.
The URLs for resour ces som et im es change. You can alway s sear ch
for t he ODBC .NET dat a pr ovider at t he MSDN download sit e t o
obt ain it s curr ent download locat ion.
The t hr ee pr ov iders t ak en t oget her offer fast , highly focused access t o select ed
dat a sources as well as general access t o a w ide range of possible dat a sources.
The SQL Ser ver .NET dat a provider is opt im ized for SQL Ser ver 7.0 and SQL
Ser ver 2000. This dat a prov ider connect s dir ect ly t o a SQL Serv er inst ance.
The OLE DB .NET dat a prov ider connect s t o OLE DB dat a sources t hr ough t w o
int erm ediat e lay ers— t he OLE DB Serv ice Com ponent and t he classic OLE DB
prov ider int roduced along w it h ADO. The OLE DB Serv ice Com ponent m anages
connect ion pooling and t ransact ion serv ices. The classic OLE DB prov ider , in t urn,
dir ect ly connect s t o a dat abase serv er . Micr osoft explicit ly t est ed t he OLE DB .NET
dat a provider w it h SQL Ser ver, Or acle, and Jet 4.0 dat abases. Use t he OLE DB
.NET dat a provider t o connect t o t he SQL Serv er 6.5 v ersion and earlier ones.
This pr ov ider is also good for connect ing t o y our Micr osoft Access solut ions based
on t he Jet 4.0 engine.
The OLE DB .NET dat a prov ider definit ely doesn’t wor k w it h t he OLE DB prov ider
for ODBC dat a sources ( MSDASQL) . Because t he .NET OLE DB dat a pr ovider
doesn’t connect t o ODBC dat a sources, y ou requir e t he ODBC .NET dat a prov ider
for connect ing t o ODBC dat a sources fr om y our .NET Fr am ew ork solut ions.
Ther e ar e four m ain .NET dat a pr ov ider classes for int eract ing w it h a rem ot e dat a
source. The nam es of t hese classes change slight ly for each t ype of pr ov ider, but
each .NET dat a prov ider has t he sam e four kinds of classes. The 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 Out put w indow. The
SqlDat aAdapt er class act s as a bridge bet w een a r em ot e SQL Ser ver dat a source
and a Dat aSet class inst ance inside a Visual Basic .NET solut ion.
A dat a set in a Visual St udio solut ion is a fift h t y pe of ADO.NET class. A dat a set
can cont ain m ult iple t ables. A sixt h ADO.NET class is t he Dat aView class, w hich
act s lik e a v iew based on a t able w it hin a Dat aSet obj ect . Windows For m s in
Visual Basic .NET applicat ions can bind only t o t ables w it hin a Dat aSet obj ect and
Dat aView obj ect s. I exam ine t he Dat aSet obj ect lat er in t his sect ion. Chapt er 10
includes a syst em at ic sum m ary of all six ADO.NET classes t hat r ev iews select ed
propert ies and m et hods of each class. The ov er view of ADO.NET classes in
Chapt er 10 is support ed by num erous code sam ples t hat illust rat e how t o
m anipulat e inst ances of t he classes program m at ically .
N ot e
I n or der t o use abbreviat ed nam es, such as t hose list ed in
t his sect ion for t he SQL Serv er .NET dat a pr ovider class
inst ances, y our applicat ion needs a refer ence t o t he SqlClient
nam espace. You can cr eat e such a reference wit h an I m port s
Sy st em .Dat a.SqlClient st at em ent j ust befor e a Module
declarat ion.
An inst ance of t he SqlConnect ion class can int erface direct ly w it h a SQL Serv er
dat a source. Use a const ruct or st at em ent t o inst ant iat e a SqlConnect ion obj ect
from t he SqlConnect ion class. The const ruct or st at em ent is a new t ype of sy - nt ax
for .NET Fram ew or k solut ions. This t ype of st at em ent perm it s y ou t o declare,
inst ant iat e, and pass st art up param et ers t o an obj ect based on a class. Wit h t he
SqlConnect ion const ruct or st at em ent , y ou can specify a connect ion st r ing as an
argum ent for t he const r uct or st at em ent . Alt er nat iv ely, you can assign t he
connect ion st r ing t o t he SqlConnect ion obj ect aft er it s inst ant iat ion w it h a
propert y assignm ent st at em ent for t he Connect ionSt ring propert y. The follow ing
line shows t he synt ax t o inst ant iat e a new SqlConnect ion obj ect , My SQLCnn1,
wit h a connect ion st r ing designat ing int egrat ed secur it y t o t he m ydb dat abase on
t he m yserv er inst ance of SQL Serv er. You don’t hav e t o explicit ly indicat e a
prov ider because t he const ruct or st at em ent r ev eals t he t ype of prov ider t hr ough
it s r efer ence t o t he SqlConnect ion class.
Dim MySQLCnn1 As New _
SqlConnection(“Integrated Security=SSPI;" & _
"Data Source=myserver;Initial Catalog=mydb")
Aft er inst ant iat ing a SqlConnect ion obj ect , you need t o invoke it s Open m et hod
befor e t he obj ect can link anot her obj ect based on one of t he ot her SQL Ser ver
.NET dat a provider classes, such as SqlCom m and, SqlDat aAdapt er, or
SqlDat aReader , t o a SQL Serv er inst ance. I nv oke t he Close m et hod t o recover t he
resources for a SqlConnect ion obj ect w hen your solut ion no longer needs it . The
Close m et hod rolls back any pending t ransact ions and releases t he connect ion t o
t he connect ion pool. The Dispose m et hod is also available for r em ov ing
connect ions, but it inv okes t he Close m et hod and perform s ot her .NET
adm inist rat iv e funct ions. Microsoft r ecom m ends t he Close m et hod for r em oving a
connect ion. Unclosed connect ions ar en’t r et urned t o t he connect ion pool.
19. Abram’s first visit seems to have been made at or near the
beginning of the Hyksos era. The most recent date of the beginning
of the rule of the Shepherd Kings is that of Wilkinson, 2091 B. C.,
and if the date usually given for the visit of Abram was 1920 B. C.,
then these invaders had already had possession of the land for over
170 years. Egypt was therefore renowned and its rulers were of a
race acquainted with the employments to which Abram was not a
stranger. They spoke the dialect of Canaan, as it is very evident that
many came from the region of Canaan.
24. Abram was near Hebron, twenty miles west of the Dead
Sea, when the news reached him of the defeat of the kings of
Sodom and Gomorrah and the capture of Lot. Hebron is almost
equidistant from the north and south ends of the Dead Sea, at an
elevation of nearly 3,000 feet above the Mediterranean, while the
waters of the Dead Sea are 1,293 feet below those of the
Mediterranean.
THE ISHMAELITES.
27. Some years after this battle we have the account of the
birth of Ishmael, the son of Abram by Hagar. As the descendants of
Ishmael exerted great influence in years afterward, it is well at this
point to study the early history of this son of Abram. When Isaac
was born Ishmael was about 16 years of age, Gen. 17:21, 25;
21:1, 8, and until the day of the divine promise to Abram, at which
time his name was changed to Abraham, he was evidently, from the
context, greatly attached to Ishmael. Moreover, Abram was
considered by his neighbors as “a mighty prince among them,”
Gen. 23:6. Under these circumstances this only son must have been
allowed privileges and attentions at the hands of the hundreds of
Abram’s servants such as an heir apparent to all the wealth of Abram
would be certain to receive. When, however, Sarah became the
mother of Isaac a change necessarily transpired. Ishmael was no
longer the expected heir. Hagar’s spirit of self-importance, which
showed itself before so positively that she was forced to leave the
family, was now repeated in some disagreeable actions of her son
Ishmael, and, despite the persistent love of Abraham, Ishmael and
his mother were summarily dismissed from the family.
28. There can be no reasonable doubt that the action of
Abraham in sending Hagar and her son out upon the desert with
only sufficient food to support them for a time was greatly or almost
entirely influenced by the direct revelation to Abraham that the
divine interference would be exerted on behalf of the exiles. That
had been assured, as we see in verses 12 and 13 of chapter 21. At
the same time both the mother and son, after all the preceding
years of privilege, would naturally imagine that a great wrong had
been done them, and Ishmael readily became a wild wanderer upon
the vast deserts east of Egypt.
The life of Isaac seems to have been spent chiefly in the region of
Beersheba, but he died at Hebron, at the age of 180 years. Esau and
Jacob are his only sons named in the sacred history.
JACOB.
7. Jacob was a native of Beersheba, and, having incurred the
displeasure of his brother Esau by the practice of a deceitful act
towards his father, as narrated in the text, Gen. 27, fled to the same
region whence his father obtained his own wife, and there found his
wives Leah and Rachel in Mesopotamia.
8. Jacob and his twelve sons remained near Hebron for some
time after the death of his father Isaac, when an event occurred
which changed the history of the entire family and led to their long
residence in the land of Egypt.
Gilead was the large district east of the Jordan, beginning some
15 miles southwest of Damascus, and whose southern limit was a
few miles north of the Dead Sea. Their way towards Egypt was by
Dothan, where the brethren were tending their father’s flock.
14th year. The rest born during the six remaining years; Joseph now
born.
20th year. At the close of the last seven years Jacob is newly employed
for six years, which, with the previous 14 years, makes 20 years with
Laban, Gen. 31:38.
21st year. Jacob and all the family start for Canaan, and reach
Shechem, including stoppages, in the 21st year, or 13th year after
Reuben’s birth.
29th year. At the close of this year Simeon and Levi attack the
Shechemites. This would make Reuben about 21 or 22, and Simeon and
Levi 19 and 20, but old enough, with their servants and probably others,
to have executed their revenge. But we must understand that this is the
extreme shortest period, and several circumstances might have detained
them longer on their journeys and made the sons older.
9. The name for the Nile used in the Hebrew is the Egyptian
name for that river found in the papyri, and translated in our English
version as “the river.” It is not the word the Hebrews used for a river,
and its use proves that the writer was familiar with Egyptian usage.
CHAPTER I.
THE ISRAELITES IN EGYPT.
1. How long after the death of Joseph the Israelites remained
in Goshen until they were enslaved has not as yet been determined.
The account in the book of Exodus opens with the significant
expression that “there arose up a new king over Egypt who knew
not Joseph.” It has been supposed that Joseph was governor under
the last of the Shepherd Kings, but this supposition is uncertain, and
perhaps wrong, for the long life of Joseph after he came into Egypt,
namely 80 years, added to the necessarily advanced age of the
Pharaoh who was upon the throne on the arrival of Joseph, would,
with greater probability, lead us to suppose that Joseph’s sojourn in
Egypt was extended through more than one reign of the Shepherd
Kings.
2. But at the end of the happy, quiet Shepherd era, among the
descendants of Jacob in Goshen there came a change. The Israelites
became enslaved, for the mandate of the Pharaoh of the period
went forth to set over them taskmasters and to afflict them with
burdens, the object being to put a stop to their excessive growth in
numbers.
9. The third plague was more intense; it afflicted man and brute
alike. The ground brought forth insects, “lice” so called, in such
abundance that even the priests could not cleanse themselves. The
priests were not allowed to use woollen in any of their garments,
because of the likelihood that it would harbor this vile evil, which
was one greatly abhorred. Insects of every kind, even gnats, were
considered unclean. Priests and people were alike unclean.
12. The sixth was yet more distressing, for it sent boils and
“blains” upon man and beast, not even the magicians being able to
stand in the presence of Moses “because of the boils.”
13. The seventh plague was one not only of hail, but of fearful
displays of lightning and peals of thunder, such as were never before
known in the land.
15. The ninth was intense darkness, in which plague not only
was there an exceeding discomfort felt throughout the land, but the
sun, which was the most sacred object of reverence, the supreme
god of Egypt, withdrew his light before the command of Moses, as
servant of the most high God.
16. The tenth plague was by far the most fearful of all. It was
to the Egyptians both distressing and ominous. The first-born was, in
a most loving sense, the most important member of the family—the
one, above all the rest, upon whom the privileges of birthright were
laid and who was, accordingly, regarded with special attention and
love. Besides, in this fearful and sudden death of the first-born in
every place there was felt, as never before, the presence of some
awful power immediately back of this plague, which seemed to them
to presage the approach of the destruction of the entire nation, and
hence their outcry, “We be all dead men,” Exod. 12:33.
It is 200 miles, a little east of north, from Mt. Sinai to the south
end of the Dead Sea and to the lower limits of the land of Canaan,
whither the Israelites were journeying. Mt. Sinai is about 35 miles
from the western and about 25 from the eastern arm of the Red
Sea.
6. Very few of the stations named after crossing the Red Sea
can be certainly located. But after leaving Mt. Sinai, at three days’
journey Prof. Palmer discovered the evidences of an ancient camp,
surrounded by an immense number of graves, and this place is
generally supposed to mark the site of a station called Kibroth-
hattaavah, or “the graves of gluttony,” the history of which is found
in Num. 11:31‒35. A day’s journey north of this the same explorer
discovered other extensive remains of stone heaps and circles
covering the hillsides in every direction. As the next station of the
Israelites is called Hazeroth, which means “the circles,” and as the
Arabs still call this place the “look-outs of Hazeroth,” it seems that
the site of another station is known.
7. After this it is difficult to trace their course until they reached
Kadesh, which is 140 miles due east of their first camping-ground
in Egypt, namely, Succoth, and at present seems identical with the
spot called Ain Gadis, or the spring of Kadesh, 170 miles north by
east from Sinai, and 65 miles southwest of the Dead Sea.
The first census was taken at Sinai in the second year after the
crossing of the Red Sea, Num. 1:46, and was 603,550. The second
census was taken nearly 40 years afterwards, just before the
entrance into the promised land, Num. 26:51, and was 601,730, the
difference being 1,820. The census included only the able-bodied
men fit for war and over 20 years of age.
The name Jericho seems to mean the “city of the moon,” a name
given to the city because of the early worship of the moon at that
place under the title Ashtoreth, which doubtless was derived from
the earlier title of the Babylonian Astarte, the goddess of love. It was
given about this time to a city in Bashan called Ashteroth Karnaim,
meaning Ashtoreth of the two horns, Gen. 14:5.
CANAAN.
9. This was the name of the land which the Israelites were now
to conquer. The name was well known to the Egyptians, and we find
it upon the monuments in Egypt and in Assyria. A description of this
land occurs in Egyptian records as early as the time of Thothmes III.
(1600 B. C., Brugsch), also in the reign of Rameses II., “the Pharaoh
of the oppression” (1350 B. C., Brugsch), and from these
descriptions it is plain that the land was settled by numerous tribes
who were well provided with the comforts of living.
They were not only numerous, but many of their cities were
strongly defended by fortresses. The list of articles recovered by
Rameses II. after his battles in Canaan bore testimony to the wealth
of the people and to the luxuries of their times, for among many
other articles were ivory, ebony, chariots inlaid with gold and silver,
suits of armor, fragrant woods, gold dishes with handles, collars and
ornaments of lapis lazuli, silver dishes, vases of silver, precious
stones, brazen spears, etc., “the plunder in fact of a rich and civilized
country.”67
THE AMORITES.
10. The land of Canaan at the time of Joshua was no
barbarous or ill-defended region. In the assault upon the Canaanitish
city of Dapur68 by Rameses II. the standard of the Amorites appears
hoisted on the highest tower of its citadel.69 From the pictures of the
Amorites upon the monuments in Egypt they were armed with the
bow and the oblong shield, and used chariots of solid construction fit
for rough ground, and it is probable that the “sons of Anak,”
Num. 13:33, were a distinguished clan among the Amorites and not
a distinct people.70 They were selected for their size and strength.
THE HITTITES.
11. It has been only recently that the history of the Hittites has
come to light. The earliest references to this people in secular
history are those which are found in the history of Assyria. They are
first mentioned in Scripture as the sons of Heth, Gen. 23:3, in
connection with the purchase by Abraham of the cave of Machpelah
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookultra.com