100% found this document useful (1 vote)
11 views

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

The document promotes the book 'Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET' by Rick Dobson, providing links to download it and other related ebooks. It includes a detailed table of contents outlining various programming topics and features of Visual Basic .NET in relation to SQL Server. Additionally, it contains a foreword and acknowledgments highlighting the author's background and support received during the book's creation.

Uploaded by

rneenpaun
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
11 views

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

The document promotes the book 'Programming Microsoft SQL Server 2000 with Microsoft Visual Basic NET' by Rick Dobson, providing links to download it and other related ebooks. It includes a detailed table of contents outlining various programming topics and features of Visual Basic .NET in relation to SQL Server. Additionally, it contains a foreword and acknowledgments highlighting the author's background and support received during the book's creation.

Uploaded by

rneenpaun
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

Visit https://ebookultra.

com to download the full version and


explore more ebooks or textbooks

Programming Microsoft SQL Server 2000 with


Microsoft Visual Basic NET 1st edition Edition
Rick Dobson

_____ Click the link below to download _____


https://ebookultra.com/download/programming-microsoft-sql-
server-2000-with-microsoft-visual-basic-net-1st-edition-
edition-rick-dobson/

Explore and download more ebooks or textbooks at ebookultra.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Programming Microsoft Visual Basic NET Version 2003


Francesco Balena

https://ebookultra.com/download/programming-microsoft-visual-basic-
net-version-2003-francesco-balena/

Programming with Microsoft Visual Basic 2012 6th Edition


Diane Zak

https://ebookultra.com/download/programming-with-microsoft-visual-
basic-2012-6th-edition-diane-zak/

Microsoft SQL Server 2012 T SQL 1st Edition Tom Coffing

https://ebookultra.com/download/microsoft-sql-server-2012-t-sql-1st-
edition-tom-coffing/

Sams Teach Yourself Microsoft SQL Server 2000 in 21 Days


2nd Edition Richard Waymire

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/

Inside Microsoft SQL Server 2008 T SQL Querying 1st


Edition Itzik Ben-Gan

https://ebookultra.com/download/inside-microsoft-sql-
server-2008-t-sql-querying-1st-edition-itzik-ben-gan/

Mastering Microsoft Visual Basic 2008 Evangelos Petroutsos

https://ebookultra.com/download/mastering-microsoft-visual-
basic-2008-evangelos-petroutsos/

The Microsoft Data Warehouse Toolkit With SQL Server 2008


R2 and the Microsoft Business Intelligence Toolset 2nd
edition Edition Kimball
https://ebookultra.com/download/the-microsoft-data-warehouse-toolkit-
with-sql-server-2008-r2-and-the-microsoft-business-intelligence-
toolset-2nd-edition-edition-kimball/
Programming Microsoft SQL Server 2000 with Microsoft
Visual Basic NET 1st edition Edition Rick Dobson Digital
Instant Download
Author(s): Rick Dobson, Paul Cornell
ISBN(s): 9780735615359, 0735615357
Edition: 1st edition
File Details: PDF, 10.60 MB
Year: 2002
Language: english
Program m ing Microsoft ® SQL Server™ 2000 wit h Micr osoft Visual
Basic® .NET

Foreword

Acknow ledgm ent s

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

2. Tables and Dat a Types


Chapt er Resources
Dat a Types for Tables
Scr ipt ing Tables

3. Pr ogram m ing Dat a Access wit h T- SQL


I nt r oduct ion t o Dat a Access wit h T- SQL
Aggregat ing and Grouping Rows
Processing Dat es
Joins and Subquer ies

4. Pr ogram m ing Views and St ored Procedures


I nt r oduct ion t o Views
Creat ing and Using Views
Views for Rem ot e and Het erogeneous Sources
I nt r oduct ion t o St ored Procedur es
Creat ing and Using St or ed Procedures
Processing St or ed Procedur e Out put s
I nsert ing, Updat ing, and Delet ing Rows
Program m ing Condit ional Result Set s

5. Pr ogram m ing User - Defined Funct ions and Tr iggers


I nt r oduct ion t o User - Defined Funct ions
Creat ing and I nv ok ing Scalar UDFs
Creat ing and I nv ok ing Table- Valued UDFs
I nt r oduct ion t o Tr iggers
Creat ing and Managing Tr iggers

6. SQL Serv er 2000 XML Funct ionalit y


Overv iew 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 Secur it y


Overv iew of SQL Serv er Secur it y
I nt r oduct ion t o Special Securit y I ssues
Sam ples for Logins and Users
Sam ples for Assigning Perm issions

8. Overv iew of t he .NET Fram ework


An I nt r oduct ion t o t he .NET Fram ework
An Overv iew of ASP.NET
XML Web Ser v ices

9. Cr eat ing Windows Applicat ions


Get t ing St art ed w it h Windows For m 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. Progr am m ing Windows Solut ions w it h ADO. NET


An Overv iew of ADO.NET Obj ect s
Making Connect ions
Wor k ing w it h Com m and and Dat aReader Obj ect s
Dat aAdapt ers , Dat a Set s, Form s, and Form Cont rols
Modify ing, I nsert ing, and Delet ing Rows

11. Progr am m ing ASP.NET Solut ions


Rev iew of ASP.NET Design I ssues
Creat ing and Running ASP.NET Solut ions
Session St at e Managem ent
Dat a on Web Pages
Validat ing t he Dat a on a Web Page

12. Managing XML wit h Visual Basic .NET


SQL Ser ver Web Releases
Overv iew of XML Technologies
Generat ing XML Docum ent s wit h t he .NET Fram ework
Dy nam ically Set t ing an XML Result Set
The I nt erplay Bet w een XML and Dat a Set s
Creat ing HTML Pages wit h XSLT

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

About t he Aut hor


For e w or d
During m y five years at Micr osoft , I ’v e been helping developers underst and
t echnologies such as Microsoft Visual St udio, Microsoft SQL Ser ver, and Micr osoft
Office Developer. Dur ing t he past t wo years, I hav e w orked on t he Microsoft
Office XP Visual Basic Language Refer ence, and now, t he MSDN Office Dev eloper
Cent er. I n t he m ont hly colum n on MSDN, Office Talk, I have wr it t en art icles t o
help Office developers underst and t he .NET plat for m and how it affect s t heir
curr ent and fut ure developm ent effort s.
As I wr it e t his for ew ord t o Rick Dobson’s book on program m ing Microsoft SQL
Ser ver solut ions wit h Microsoft Visual Basic .NET, I t hink back t o m y own
experiences dev eloping soft war e applicat ions w it h Visual Basic. My first
experience wit h Visual Basic was lear ning t he language using v ersion 3.0. I
rem em ber pick ing up m y first Visual Basic beginner’s book and being excit ed as I
dev eloped m y first few “ Hello, Wor ld” applicat ions. I couldn’t believ e how quick
and easy it was t o dev elop soft ware applicat ions t hat operat ed sim ilar ly t o ot her
popular sharewar e program s of t hat t im e.
Howev er, dur ing t hat t im e I also discov er ed som e of t he short com ings of Visual
Basic as an ent erpr ise- lev el developm ent language. I t was t hen t hat I t ur ned m y
at t ent ion t o C+ + . I r em em ber being v ery frust rat ed at t r y ing t o lear n t he
language, t ry ing t o underst and concept s such as point ers, m em ory allocat ion,
and t rue obj ect - or ient ed program m ing. I t ook classes on C+ + at t he local
universit y , but I got even m or e fr ust rat ed hav ing t o wait m ont hs unt il I was
t aught 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 t ry ing t o
lear n C+ + and hav e been using Visual Basic t o dev elop soft ware applicat ions ever
since.
As each new v ersion of Visual Basic was r eleased, I readied m yself t o learn new
soft war e developm ent t echnologies. First it was Act iveX cont rol developm ent .
Then it was calling t he Windows API . Next it was DHTML Applicat ions. Then it was
dat abase dev elopm ent using Micr osoft SQL Ser ver. I t alw ays seem ed as t hough I
had t o lear n a new language and a new developm ent paradigm for ev er y new
t echnology t hat cam e along. I kept t hink ing t hat t her e had t o be an easier and
m or e unified appr oach.
Well, now w e’ve r eached t he adv ent of t he Micr osoft .NET plat form , and wit h it , a
revolut ion in t he Visual Basic language, Microsoft Visual Basic .NET. I believ e t hat
Visual Basic .NET will pr ov ide soft ware dev elopers wit h new opport unit ies for
quickly and easily designing int egrat ed soft war e applicat ions t hat connect
businesses and indiv iduals anyt im e, anyw her e, and on v irt ually any soft ware
dev ice. Wit h advances in t he Visual Basic .NET language, Visual Basic . NET
dev elopers will finally be on a par w it h t heir C+ + and C# count erpart s,
part icipat ing in m any high- end dev elopm ent pr oj ect s. Wit h Visual St udio .NET
feat ur es such as cross- language debugging, along w it h Visual Basic .NET
conform ance t o t he com m on t ype syst em and t he com m on language r unt im 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 eloper s now possess.
Tr ue obj ect - orient ed pr ogram m ing is now available in Visual Basic .NET, including
feat ur es such as inher it ance and m et hod ov er loading. I t ’s now sim pler t o call t he
Windows API by using t he .NET Fram ew or k Class Libraries. Web applicat ion
dev elopm ent is now as easy as dev eloping Windows form s–based applicat ions.
Dat abase applicat ion developm ent is m ade easier by unit ing disparat e dat a obj ect
libraries such as DAO, RDO, OLE DB, and ADO under ADO. NET, ut ilizing t he
power of XML t o consum e and t ransm it r elat ional dat a ov er com put er net w orks.
And a new t echnology, XML Web serv ices, allows Visual Basic .NET developers t o
host t heir soft ware applicat ions’ logic ov er t he Web. Addit ionally , a big issue for
soft war e developers t oday is t hat of soft war e applicat ion deploym ent and
versioning. I f y ou don’t agree, j ust ask any soft ware dev eloper about “ DLL hell,”
and y ou’re bound t o get an earful. For m any .NET applicat ions, t he .NET plat form
feat ur es “ copy and past e” or XCOPY deploym ent . ( Users sim ply copy y our
applicat ion files from t he source m edia t o any single direct ory and r un t he
applicat ion. ) And because .NET no longer r elies on t he r egist ry , virt ually all DLL
com pat ibilit y issues go away.
Wit h t his book, Rick aim s t o give you t he sk ills y ou need t o pr ogram SQL Serv er
solut ions wit h Visual Basic .NET. I k now y ou w ill find Rick’s book helpful. Rick
brings his exper ience t o bear from t hree prev ious books: Pr ogram m ing Micr osoft
Access Version 2002 ( Microsoft Press, 2001) , Pr ogram m ing Micr osoft Access 2000
( Micr osoft Press, 1999) , and Pr ofessional SQL Serv er Developm ent wit h Access
2000 ( Wr ox Pr ess I nc., 2000) . Rick also br ings his exper ience of leading a
successful nat ionwide sem inar t our. Mor e im port ant , I know y ou w ill enj oy Rick ’s
book because of his deep int erest in Visual Basic .NET and SQL Ser ver, and in
helping y ou, t he pr ofessional dev eloper, underst and and apply t hese t echnologies
in y our daily soft ware applicat ion dev elopm ent proj ect s.
Paul Cornell MSDN Office Dev eloper Cent er
ht t p: / / m sdn.m icr osoft .com / officeMicrosoft Corporat ion February 2002
Ack now le dgm e nt s
This sect ion offers m e a chance t o say t hank you t o all w ho helped m ak e t his
book possible. I wish t o offer special recognit ion t o five support r esources.
First , t he folks at Microsoft Press have been fant ast ic. Dave Clar k, an acquisit ions
edit or , select ed m e t o w rit e t he book j ust m ont hs aft er I com plet ed anot her book
for Microsoft Press. Dick Br ow n, m y pr oj ect edit or, st aunchly st ood up for his
percept ion of how t o m ake t he book ’s organizat ion and cont ent clear t o y ou
wit hout being pet t y or bor ing t o m e. Dick also light ened m y load subst ant ially by
show ing a real k nack for edit ing m y t ext w it hout dist ort ing t he or iginal int ent .
When Dick was especially busy, he handed off som e of his load t o Jean Ross, who
also did an adm irable j ob. Ot hers at Micr osoft Press who cont r ibut ed t o m y w ell-
being in one way or anot her include Aar on Lavin and Anne Ham ilt on.
Second, I had excellent wor k ing r elat ions wit h sev eral professionals w it hin
Micr osoft . Paul Cor nell, a widely k now n t echnical edit or at Micr osoft , w as kind
enough t o share his insight s on how t o pr esent .NET concept s com pellingly. I
want t o t hank Paul especially for writ ing t he For eword t o t his book. Kart hik
Rav indran serv ed as t he MSXML Bet a Pr oduct Lead Engineer at Microsoft Pr oduct
Support Serv ices dur ing t he t im e t hat I wrot e t his book. He provided valuable
t echnical cont ent about t he SQL Serv er 2000 Web releases. Ot her Microsoft
represent at iv es pr ov iding m oral and t echnical support for t his book include
Richard Waym ir e and Jan Shanahan.
Third, I want t o express m y appreciat ion t o t he m any r eaders, sem inar
at t endees, and sit e v isit ors w ho t ook t he t im e t o t ell m e what I did right or wrong
for t hem , and also t o t hose w ho shared t heir t echnical support quest ions wit h m e.
I t is t hr ough t his k ind of feedback t hat I am able t o k now w hat ’s im port ant t o
pract icing developers. I encourage y ou t o visit m y m ain Web sit e
( ht t p: / / www .pr ogram m ingm saccess.com ) and sign t he guest book. The ent ry
for m includes space for you t o leave your evaluat ion of t his book or y our quest ion
about a t opic cov er ed in t he book . I prom ise t o do m y best t o r eply per sonally. I n
any ev ent , I definit ely r ead all m essages and use t hem so t hat I can serv e y ou
bet t er w it h fut ur e edit ions of t his, and ot her, books.
Fourt h, I want t o t ell t he w orld how grat eful I am t o m y w ife, Virginia. Wit hout
Virginia’s warm support , lov e, and care, t his book w ould be less professional. She
reliev es m e of near ly ev er y r esponsibilit y around t he house w hen I undert ak e a
book proj ect . I n addit ion, she offers st rat egic advice on t he issues t o address and
t heir st yle of cov erage. When I r un out of t im e, she ev en pit ches in w it h t he
proofreading.
Fift h, it is im port ant for m e t o give praise and glory t o m y Lord and Sav ior, Jesus
Chr ist , w ho I believe gave m e t he st rengt h and wisdom t o w r it e t his book. I n
addit ion, He gav e m e healt h dur ing t he long gest at ion per iod t hat result ed in t he
birt h of t his book . I t is m y prayer t hat t he book pr ov e t o be a blessing t o y ou.
I nt r odu ct ion
Any one w ho buys a book —or considers buy ing it —want s t o k now w ho t he book is
for , w hat set s it apart fr om ot hers lik e it , and how t he book is organized. This
int r oduct ion cov ers t hose t hr ee quest ions, and it also discusses syst em
requir em ent s, sam ple files, and support .

• First , w h o is t h e b ook for ? Ther e ar e at least t wo answers t o t his


quest ion. One answ er is t hat t he book t arget s professional dev elopers
( and ot hers aspir ing t o be pr ofessional dev elopers) . The second group t he
book addr esses is t hose who want t o build full- feat ured, secure SQL
Serv er solut ions wit h Visual Basic .NET.
• Se con d, w h a t ’s sp ecia l a bou t t h e b ook ? I hope you com e t o believ e
t hat t he m ost im port ant answer t o t his quest ion is t hat t he book
consider ed qualit y and dept h of coverage m or e im port ant t han r ushing t o
m arket . The book w ill arr iv e on bookshelv es m or e t han t hr ee m ont hs aft er
t he official release of t he . NET Fram ew ork. I t is m y w ish t hat you der iv e
value from t he ext ra t im e t ak en t o develop t he m any code sam ples and
t he in- dept h discussions of advanced t opics, such as class inher it ance,
ASP.NET, and XML Web serv ices.
• Th ird , h ow is t h e b ook org an iz e d? The short answer is t hat t her e ar e
t wo m ain sect ions. One sect ion int roduces SQL Ser ver concept s as it
dem onst rat es T- SQL ( Tr ansact SQL) pr ogram m ing t echniques. Aft er
conv ey ing SQL Ser ver basic building blocks in t he first part , t he second
part rev eals how t o put t hose part s t oget her w it h Visual Basic .NET and
relat ed t echnologies int o SQL Ser ver solut ions for handling com m on
dat abase chores.

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.

W ho’s t h e Book For ?


This book t arget s pr ofessional Visual Basic and Visual Basic for Applicat ions
dev elopers. From m y sem inar t ours and Web sit es
( ht t p: / / www .pr ogram m ingm saccess.com and ht t p: / / www.cabinc.net ) , I know
t hat t hese professionals ar e dr iven by a passion t o deliv er solut ions t o t heir
client s t hrough applying t he m ost innov at iv e t echnologies t heir client s w ill accept .
I n- house dev elopers are t he go- t o persons for get t ing result s fast — part icular ly for
cust om in- house sy st em s and dat abases. I ndependent developers specialize in
serv ing niche sit uat ions t hat can include under - ser ved business needs and w or k
ov erflows. I n bot h cases, t hese pr ofessionals need t raining m at erials t hat addr ess
pract ical business requir em ent s w hile showcasing innov at ive t echnologies wit hout
wast ing t heir t im e. This book st rives t o ser ve t his broad need in t w o 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 Ser ver 2000 solut ions wit h Visual Basic .NET. The book focuses
on t he int egrat ion of SQL Serv er 2000 w it h .NET t echnologies t apped v ia Visual
Basic .NET. I t is m y fir m belief t hat y ou cannot creat e gr eat SQL Ser v er solut ions
in any program m ing language w it hout k nowing SQL Server. Therefore, t his book
goes beyond t radit ional coverage of SQL Serv er for Visual Basic dev elopers. You’ll
lear n T- SQL pr ogram m ing t echniques for dat a access, dat a m anipulat ion, and
dat a definit ion. A whole chapt er equips you t o secur e your SQL Ser ver solut ions.
I n addit ion, t her e’s plent y of cont ent in t his book on Visual Basic .NET and relat ed
t echnologies, such as ADO.NET, ASP.NET, XML ( Ex t ensible Mark up Language) ,
and XML Web serv ices. The present at ion of t hese t echnologies dem onst rat es
coding t echniques and ex plor es concept s t hat equip y ou t o build bet t er solut ions
wit h SQL Ser ver 2000 dat abases. I n addit ion, t he book highlight s innovat ions
int r oduced t hrough t he Web releases for SQL Serv er 2000 t hat int egrat e SQL
Ser ver 2000 t ight ly w it h Visual Basic .NET.
This isn’t a book about XML, but t hr ee of t he book ’s 13 chapt ers focus in w hole or
in part on XML. Therefore, t hose seek ing pract ical dem onst rat ions of how t o use
XML w it h SQL Ser ver and Visual Basic .NET w ill deriv e value fr om t his book . I f
you hav e look ed at any of t he com put er m agazines ov er t he past couple of y ears,
you k now t hat XML is com ing t o a solut ion near you. However, t he rapid pace of
XML innovat ion m ay have dissuaded som e fr om j um ping on t he bandwagon w hile
t hey wait t o see w hat ’s going t o last and what ’s j ust a fad. I n t he book’s t hr ee
chapt ers on XML t echnology, you’ll learn about XML docum ent s, 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)
quer ies, XSLT ( Ext ensible St y lesheet Language Transform at ion) , and WSDL ( Web
Ser vices Descript ion Language) .

W ha t ’s Spe cia l Abou t Th is Book ?


Ther e ar e sev eral feat ur es t hat m ake t his book st and apart from t he flood of
books on .NET. One of t he m ost im port ant of t hese is t hat t his book didn’t rush t o
m ark et but rat her shipped m ont hs aft er t he r elease of t he .NET Fram ew ork . This
allowed m e enough t im e t o filt er, exam ine, and uncov er w hat w er e t he m ost
useful and innovat iv e feat ur es for Visual Basic .NET developers building SQL
Ser ver solut ions. For ex am ple, t he book includes a whole chapt er on creat ing
solut ions wit h XML Web serv ices. That chapt er includes t wo m aj or sect ions on t he
SQL Ser ver 2000 Web Serv ices Toolk it , w hich didn’t ship unt il t he day of t he .NET
Fram ew ork release.
The .NET Fram ew ork cont ent is at a professional lev el, but it isn’t j ust for t echies.
This book doesn’t assum e any pr ior know ledge of t he .NET Fr am ew ork . I t does
assum e t hat you get paid for building solut ions program m at ically and t hat at least
som e of t hose solut ions are for SQL Serv er dat abases. Ther efor e, t he book
explains basic .NET concept s and dem onst rat es how t o achiev e pract ical result s
wit h t hose concept s t hr ough a huge collect ion of .NET code sam ples.
This book is about building solut ions for SQL Ser ver 2000. I include coverage of
t he m any special feat ur es t hat t ie Visual Basic .NET and SQL Serv er 2000 closely
t o one anot her. Alt hough t here is coverage of general .NET dat abase t echniques,
t his book div es deeply int o T- SQL pr ogr am m ing t echniques so t hat y ou can creat e
your own cust om dat abase obj ect s, such as t ables, st or ed pr ocedur es, views,
t riggers, and user - defined funct ions. I n addit ion, t her e is separat e cov erage of
t he XML feat ures released w it h SQL Serv er 2000 as well as separat e coverage of
t he XML feat ures in t he first t hr ee Web releases t hat shipped for SQL Ser ver
2000. There ar e num er ous code sam ples t hroughout t he book. These will equip
you t o build solut ions w it 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 aut hor, Rick
Dobson. I have t rained professional dev elopers in Aust ralia, England, Canada,
and t hr oughout t he Unit ed St at es. This is m y fourt h book in four years, and you
can find m y art icles in popular publicat ions and Web sit es, such as SQL Serv er
Magazine and MSDN Online. As a Webm ast er , m y m ain sit e
( ht t p: / / www .pr ogram m ingm saccess.com ) serv es hundr eds of t housands of
sessions t o dev elopers each y ear. I const ant ly ex am ine t heir v iewing habit s at t he
sit e t o det erm ine w hat int erest s t hem . I n addit ion, m y sit e feat ures scores of
answers t o t echnical support quest ions subm it t ed by professional developers. My
goal in offer ing answers t o t hese quest ions is t o st ay in t ouch w it h pract icing
dev elopers wor ldw ide so t hat m y new book s address t he needs of pract icing,
professional dev elopers.

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

Chapt er 8 st art s t he .NET part of t he book w it h a r ev iew of select ed .NET t opics


t hat ar e cover ed in t he init ial look Chapt er 1 offer ed at t he .NET Fram ewor k. This
chapt er pr ov ides an ov erv iew of t he archit ect ur e for .NET solut ions, and it dr ills
down on t wo t opics: ASP.NET and XML Web ser vices. The general purpose of t his
chapt er is t he sam e as Chapt er 1, w hich is t o int r oduce concept s. The em phasis
in Chapt er 8 isn’t how y ou do som et hing, but rat her w hat are t he m aj or
t echnologies enabling y ou t o do som et hing. Chapt er 1 and Chapt er 8 are bot h
relat iv ely short chapt ers, but you m ay find t hem invaluable if y ou are t he k ind of
person w ho benefit s from high- lev el ov er views of a collect ion of t opics.
Chapt er 9 st art s wit h a close exam inat ion of how t o use Windows Form s wit h
Visual Basic .NET. I t t hen shift s it s focus t o a review of t radit ional class
processing concept s via Visual Basic .NET as an int r oduct ion t o class inherit ance,
a new obj ect - or ient ed feat ure t hat m ak es it s fir st appearance in Visual Basic w it h
Visual Basic .NET. Next t he t r eat m ent of classes progr esses t o t he handling of
built - in ev ent s as w ell as t he raising of cust om ev ent s. Finally t he chapt er closes
wit h an exam inat ion of t he new except ion handling t echniques for pr ocessing r un-
t im e errors.
Chapt er 10 is a how - t o guide for solut ions t o t y pical pr oblem s w it h ADO.NET.
Befor e launching int o it s progr ession of sam ples show ing how t o perform all k inds
of t asks, t he chapt er st art s wit h an ov er v iew of t he ADO.NET obj ect m odel t hat
covers t he m ain obj ect s along w it 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 fr om SQL Ser ver dat abase obj ect s, as well as dat a m anipulat ion
t asks, such as insert ing, updat ing, and delet ing rows in a t able. Work ing t hr ough
t he sam ples in t he how - t o guide offers a hands- on feel for using t he
Syst em .Dat a.SqlClient nam espace elem ent s t o per form t ypical t asks.
Chapt er 11 swit ches t he focus t o t he Web by addressing t he cr eat ion and use of
ASP.NET solut ions. This chapt er st art s by int r oducing basic elem ent s t hat you
need t o k now in order t o use ASP.NET t o cr eat e great Web solut ions wit h Visual
Basic .NET. These include lear ning w hat happens as a page does a r ound- t r ip
from a browser t o a Web serv er and back t o t he br owser— part icularly for dat a
associat ed wit h t he page. Ot her pr elim inary t opics t hat equip y ou for building
professional Web solut ions include running t he sam e page in m ult iple br owser
t ypes and sniffing t he browser for cases in w hich y ou want t o send a page
opt im ized for a specific kind of browser t ype. Managem ent of session st at e is a
m aj or t opic in t he chapt er , and y ou lear n how t o use enhancem ent s t o Session
variables for Web farm s as well as t he new v iew st at e var iables, a non- ser ver -
based t echnique for m anaging st at e in ASP.NET solut ions. The last t wo sect ions in
t he chapt er deal w it h ADO.NET t opics in ASP.NET solut ions and t he new
aut om at ic dat a validat ion feat ur es built r ight int o ASP.NET.
The last t wo chapt ers in t he book explor e how XML int erplays wit h Visual St udio
.NET and SQL Ser ver 2000. For exam ple, Chapt er 12 exam ines special t ools in
Visual St udio .NET t o facilit at e t he design and edit ing of XML docum ent s and
schem as. I n addit ion, y ou learn how t o designat e XPat h queries t hat accept run-
t im e input for r et ur ning SQL Ser ver result set s inside Visual Basic .NET program s.
The chapt er dem onst rat es t echniques for processing t he XML docum ent
associat ed wit h all ADO. NET dat a set obj ect s. I n t he chapt er’s last sect ion, I
present a couple of code sam ples t hat illust rat e how t o pr ogram st at ic HTML
pages based on XML docum ent s wit h XSLT.
Ch a pt e r 1 3 dr ills dow n on XML Web serv ices by dem onst rat ing several differ ent
approaches for cr eat ing Web serv ices as well as consum ing XML out put from Web
serv ices. Web serv ices behave som ewhat like COM obj ect s in t hat y ou can set up
serv er applicat ions for client applicat ions. The ser ver applicat ions expose m et hods
t o w hich t he client applicat ions can pass param et ers. XML com es int o play wit h
Web serv ices in a couple of areas. First , Web ser vices repr esent t heir input s and
out put s v ia WSDL, an XML- based language t hat form ally describes an XML Web
serv ice. Second, Web ser vices ret urn dat a t o t heir client s as XML docum ent s or
docum ent fragm ent s.

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.

My goal in t his chapt er is t o equip y ou concept ually for t he r est of t he book .


Ther efor e, t his chapt er includes m at er ial t hat acquaint s y ou w it h applicat ion
dev elopm ent t echniques and t opics for SQL Serv er 2000 and Visual Basic .NET.
The discussion of t he sam ples in t his chapt er generally aim s t o convey broad
approaches inst ead of how t o r un t he sam ple. All t he r em aining chapt ers except
for Chapt er 8, anot her concept ual chapt er , hav e sam ples w it h inst ruct ions aim ed
at professional dev elopers.
I believe t hat t he overw helm ing m aj or it y 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 ions— ADO. NET. I also believ e t hat m ost Visual Basic
dev elopers don’t have an int im at e know ledge of SQL Serv er — especially for
creat ing user - defined obj ect s, such as t ables, v iews, and st or ed procedur es. This
capabilit y can em pow er you t o build m or e pow erful and m or e secure applicat ions.
As y ou lear n about dat abase obj ect s and how t o creat e t hem in Chapt er 2
t hr ough Chapt er 7, reflect back on t he Visual Basic .NET cov erage in t his chapt er
and how t o m ar ry dat abase creat ion t echniques and Visual Basic .NET
dev elopm ent t echniques. One of t he best t ools t o build dat abase obj ect s is SQL
Ser ver 2000 Query Analyzer . This chapt er’s closing sect ion conveys t he basics of
Query Analyzer t hat you need t o follow t he sam ples in Chapt er 2 t hrough Chapt er
7.

Visua l St u dio .N ET, t h e V isu a l Ba sic .N ET I D E


Visual St udio .NET is t he new m ult ilanguage int egrat ed developm ent env ir onm ent
( I DE) for Visual Basic, C# , C+ + , and JScr ipt developers. I f you are dev eloping
solut ions for Visual Basic .NET, I definit ely r ecom m end t hat you use Visual St udio
.NET as y our dev elopm ent envir onm ent . This sect ion dem onst rat es how t o get
st art ed using Visual St udio .NET for dev eloping solut ions wit h Visual Basic .NET.
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 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.

St a r t ing V isu a l St udio .N ET

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.

Con figu r ing V isu a l St udio .N ET f or Visua l Ba sic .N ET

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.

Figu re 1 - 1 . M y Profile se le ct ion s for st a r t in g V isu al St u dio .N ET for a


V isu a l Ba sic de velop e r.
Usin g t h e St a r t Pa ge

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.

Cr e a t in g a n d Run n in g a Con sole Applica t ion

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.

Figu r e 1 - 2 . A Con sole a p plicat ion for displayin g a fu ll n a m e b a se d on u se r


inpu t for fir st a n d se con d n am e s.

To t he r ight of t he Module w indow are t w o ot her windows. The t op one of t hese is


Solut ion Explorer. I t shows t he file st r uct ure for t he solut ion. Solut ion Explor er
indicat es in it s first line t hat t he solut ion consist s of j ust one proj ect . Below t hat
line appears t he nam e of t he proj ect , MyNam eI sFrom Console. Wit hin t he proj ect
are t hree ent ries: one each for t he Refer ences, Assem blyI nfo.v b, and Module1.vb
elem ent s wit hin t he solut ion’s proj ect . By default , t he Propert ies window is below
Solut ion Explorer. I n t he Full Pat h pr opert y t ext box is an excerpt show ing t he
pat h t o Module1.vb on m y com put er . When y ou click t he proj ect nam e in Solut ion
Explor er, t he Pr oj ect Folder t ext box in t he Propert ies window displays t he pat h of
t he dir ect ory holding t he solut ion’s files. I t is t his direct ory t hat you copy t o
deploy your solut ion on anot her com put er w it h t he .NET Fram ew or k inst alled. The
solut ion w on’t run wit hout t he com m on language runt im e on t he com put er t o
which you copy t he direct ory cont aining t he .NET Fram ew or k solut ion. See
Chapt er 8 for m or e det ailed cov erage of t he .NET Fram ew or k, including t he
runt im e and dist ribut ing .NET Fram ework solut ions as assem blies of files in
folders.
You can t est r un t he applicat ion by choosing St art from t he Debug m enu, or by
pressing F5. This opens t he Console w indow w it h a prom pt t o ent er a first nam e.
Aft er y ou close y our applicat ion and sav e any changes t o it , y our solut ion appears
on t he St art Page for r ecent solut ions. I f you st art Visual St udio .NET and t he
solut ion y ou want t o open doesn’t appear on t he Proj ect s t ab of t he St art Page,
you can also open t he solut ion by click ing Open Pr oj ect . I n t he Open Pr oj ect
dialog box , choose t he file w it h t he .sln ext ension and t he solut ion’s nam e
( My Nam eI sFrom Console) . A solut ion can cont ain j ust one .sln file, but it can
cont ain m ult iple pr oj ect s.
You also can r un t he solut ion and open t he Console w indow dir ect ly from
Windows Explor er w it hout using Visual St udio .NET. Open t he bin subdirect ory
wit hin t he dir ect ory cont aining t he assem bly folder for t he solut ion. Then double-
click t he My Nam eI sFr om Console.ex e file. This opens t he Console w indow w it h t he
prom pt for a first nam e.

An Ove r view of AD O.N ET Ca pa bilit ie s


ADO.NET encapsulat es t he dat a access and dat a m anipulat ion for t he .NET
Fram ew ork . This sect ion giv es y ou an overv iew of t he t opic t hat equips you for a
st art er sam ple in t he next sect ion. Microsoft chose t he nam e ADO.NET for t he
.NET Fr am ew ork dat a access com ponent t o indicat e it s associat ion w it h t he ear lier
ADO t echnology for dat a access. While t her e ar e som e sim ilarit ies in sy nt ax
bet ween ADO.NET and ADO ( part icular ly for connect ion st r ings) , m any will find
t he differ ences ar e m or e obv ious t han t he sim ilarit ies. These differences
subst ant ially upgrade ADO.NET over ADO in t w o k ey ar eas— scalabilit y and XML
( Ext ensible Mark up Language) int er operabilit y. As a result , y ou w ill be able t o
creat e dat abase applicat ions w it h ADO.NET t hat serv e m or e users and shar e m ore
dat a t han y ou did w it h ADO. See Chapt er 10 for a m or e int ensive exam inat ion of
ADO.NET. Chapt er 12 explicit ly explores int eroperabilit y bet ween ADO. NET and
XML.

.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.

SqlCon n e ct ion Cla ss

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.

SqlCom m a n d a n d SqlD a t a Re a de r Cla sse s

One w ay t o put a connect ion t o use is t o em ploy it along w it h t he SqlCom m and


and SqlDat aReader obj ect s. A SqlDat aReader obj ect can m aint ain an open
for ward- only, read- only connect ion w it h a SQL Ser ver dat abase. While t he
SqlDat aReader using a SqlConnect ion obj ect is open, you cannot use t he
SqlConnect ion obj ect for any ot her purpose except t o close t he connect ion.
Closing a SqlDat aReader obj ect releases it s associat ed SqlConnect ion obj ect for
ot her uses. The SqlDat aReader class doesn’t have a const ruct or st at em ent . You
declare t he SqlDat aReader obj ect w it h a Dim st at em ent and assign a result set
from a SqlCom m and obj ect t o a SqlDat aReader wit h t he Ex ecut eReader m et hod
of t he SqlCom m and obj ect . Finally, invoke t he SqlDat aReader obj ect Read
m et hod t o open a r ow fr om t he result set in t he SqlDat aReader .
The SqlCom m and obj ect can ser ve m ult iple funct ions, including processing a T-
SQL st at em ent against a connect ion. When used in t his fashion, t he SqlCom m and
can t ake t wo argum ent s. The first 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 obj ect 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 ect .

Figu re 1 - 3 . A sch e m a t ic illu st ra t ing t h e r ou t e b y w h ich a SqlDa t a Rea de r


ob j e ct re t u r n s va lu e s t o a n a pplicat ion .
Other documents randomly have
different content
the Nile and to distribute them in case of need. This king also built
the great labyrinth in the Fayum, the latter name being an alteration
of the Egyptian word for “sea,” namely “Piom.”

16. During this period fortifications were erected on the


northeastern frontier of Egypt, which appear to have extended
across the whole of the present isthmus of Suez (Socin). The term
Shur used six times in Scripture is now supposed to refer to this
“wall.”50

17. As the pyramids of Gizeh were built in the fourth dynasty


(the most recent date of which is given by Wilkinson as 2450 B. C.),
they had been in existence more than 400 years before Abram’s
visit. The Sphinx was then existing also, as seems probable from an
inscription found by M. Mariette, which indicates that there was a
“temple of the Sphinx” in the time of Cheops,51 the builder of the
great pyramid. It seems also probable that the rule of the foreigners,
called the Shepherd Kings, had begun before Abram’s visit.

18. These foreigners took possession of Lower Egypt and drove


the original rulers up the Nile to Thebes and other parts of Upper
Egypt. Long before this period emigrants from the East had been
admitted to Egypt and had settled in various places upon the rich
lands of the Delta, until, finding themselves sufficiently powerful,
they usurped all authority without a battle. They were called the
Shepherd kings, or Hyksos, from what was supposed to be their
employment. They governed Lower Egypt for about five hundred
years, until they were finally driven out by the Egyptian royal family.

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.

20. In this age the horse is not mentioned as in Egypt. Oxen


and asses and sheep are found depicted upon the walls and tablets,
but the horse does not appear in Egypt till the reign of Thothmes I.,
who met with them in his wars in Assyria. This king was the third
Pharaoh of the eighteenth dynasty.52 This dynasty began
immediately after the expulsion of the Hyksos. So that while it is
probable that the horse might have been known only as a foreign
animal, it was introduced into Lower Egypt by Thothmes I., and
Egypt became known after this for its fine breed of horses, which
took the place of the asses previously used throughout the land. It is
for this reason that Abram’s list of animals excludes the horse,
Gen. 12:16.

THE FIRST BATTLE.


21. The next important occurrence in the history of Abram is
that of the first battle mentioned in Scripture. Abram had returned
to Canaan with large additions to his herds. This increase brought
about a necessary separation between Abram and Lot. Abram settled
in Hebron, while Lot chose his residence in the region of Sodom and
Gomorrah, the cities of the plain. Soon after four kings from
Chaldæa approached Canaan on a tour of conquest, and passing to
the south and east of the Dead Sea went down to Mt. Seir and
thence to Kadesh, then called En-mishpat, and thence north to
Hazezon-tamar. They then met the kings of Sodom and Gomorrah in
battle, defeated them, and carried off Lot and others captives. Upon
knowledge of this captivity Abram set out to overtake the invaders.
He was joined by the forces of the three Amorites confederate with
him, and found the kings at Dan, about 140 miles from Hebron
northward, as they were leaving the country on their way home to
Chaldæa. A battle now took place at night, and the four kings were
defeated, and Lot and other captives, together with the stolen
goods, were all retaken and brought back in safety.

SODOM AND GOMORRAH.


22. The exact location of these cities has not yet been
discovered. They were, with the other cities of the plain, situated
very near the Dead Sea, and the traditions place them at the
western part of the southern end, where there is a salt hill five miles
long, called the hill of Sodom, Jebel Usdum. There are good reasons
for supposing that when Abram and Lot stood overlooking the land
from the heights near Bethel, Lot chose the region north of the Dead
Sea, which was visible, in preference to the southern part, which
was more than forty miles distant. But from the Scripture account,
considered in view of the evident volcanic nature of this part of
Palestine and the fearful earthquakes which have happened in the
vicinity in recent times, there is reason to believe that some terrible
convulsion not only buried the cities, but submerged the plain at the
south end of the sea, and no other interpretation seems to suit the
history, which definitely states that the plain and all that grew upon
it were destroyed, the water system of the plain being all entirely
changed. The submerged plain at the south, therefore, which is
covered for the area of about fifty square miles with water only a
few feet deep, has given occasion for the theory that the cities of
the plain are to be sought beneath these waters, which are by some
supposed to cover the vale of Siddim.

23. Hazezon-tamar is the same as En-gedi, 2 Chron. 20:2. It is


upon the west shore of the Dead Sea, twenty-three miles south of
the mouth of the Jordan. Hobah, whither Abram pursued the kings,
is two miles north of Damascus.

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.

25. The recent discoveries in Chaldæa and the surrounding


countries show that the names of these four kings—Amraphel king
of Shinar, Arioch king of Ellasar, Chedorlaomer king of Elam, and
Tidal king of nations, are names which have in large part been found
on the tablets and in the history of the countries mentioned.
Amraphel is the same in the Hebrew as Amarphal, and it was so
translated in the Septuagint made more than 250 B. C. This name
was that of a viceroy of Sumir, the district around and south of
Babylon, called Shinar in Genesis, and the name Amar-pal has been
found “borne by private persons on two cylinders of ancient
workmanship” (Lenormant). The Septuagint has for Tidal, Thargal,
which seems to be the proper spelling; the difference between the
two spellings in the original Hebrew is only that between an r and a
d, which in that language is exceedingly small. In the Akkadian
(same as Accadian), which was the language used in the ancient
Chaldæan times, Turgal meant “great chief.”53 This king was chief of
a people called the Gutium in the monumental inscriptions, and this
tribe or small nation has been identified with the Goim of the
Hebrew text, which in our English version is translated “nations.” So
that the “Tidal king of nations,” of the text in Genesis, is shown to be
the “great chief” of a tribe living in Northern Babylonia, of which one
part became afterwards the nation of the Assyrians.54

Chedorlaomer, the monuments show us, was truly an Elamite


name, Chedor, or Kudur, forming part of several names of the early
kings of that district, and Laomer, or Lagamar, being the name of a
most important Elamite god. The name Arioch is very similar to that
of the son of an Elamite king who was king of Larsa, which itself is
similar to the Hebrew name Ellasar, and the circumstances have led
the best Assyriologists to believe that they are the very same.
26. The monumental records show that this king of Elam, on
a previous occasion, when Abram was still at Haran, had passed
over the Euphrates and conquered Phœnicia and a country to the
south. He is called both king of Elam and king of Phœnicia, as the
land of Canaan was called by name “Martu,” “the land of the setting
sun,” or Phœnicia. So that 14 years before, at the time when
Chedorlaomer crossed the Euphrates on his first expedition, Abram
may have beheld the troops of that king whom he afterward
conquered, with his viceroys, when they came on their second
invasion of Canaan. At that time Abram was with his father Terah at
Haran, as we may see from the dates in the context,
Gen. 16:3; 14:5.

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.

He was the progenitor of twelve great tribes whose names in part


are recognized among some of the tribes existing at the present day
and whose characters are accurately represented in the description
of what they were to be, as it occurs in Gen. 16:12, and the
expression “he shall dwell in the presence of his brethren” simply
alludes to the fact that his race should be wanderers upon the desert
without any fixed habitation, this being the life of all the most
pleasurable to the desert Arabs.

29. As Abraham was 99 years of age when Ishmael was 13,


Gen. 17:24, 25, and died at 175, it is plain that Ishmael must have
been about 90 years of age at Abraham’s death. The love and
reverence which Ishmael had for the patriarch were apparent after
this long time in the fact that at the death of the latter, Isaac and
Ishmael united to perform the burial at the cave of Machpelah at
Hebron, Gen. 25:9.

HEBRON AND MACHPELAH.


30. Hebron is a very old city, having been founded long before
Abram’s time, and it is in existence at present. It is south of
Jerusalem eighteen miles, and is unlike nearly all the cities in
Palestine in that it is situated in a valley. The cave of Machpelah is
on the east side of the valley, which runs nearly north and south.

This city becomes important in Biblical history at the time when


Sarah, the wife of Abraham, died, and then this cave was purchased
by Abraham as a family burying-place. It was the first spot
possessed by any of the ancestors of the Hebrew race in Palestine.
Here Sarah and Abraham were buried and in after times Leah and
Isaac, and Jacob’s remains were, by his desire, removed from Egypt
and placed by the side of his wife Leah.

Although Hebron has suffered several attacks and partial


destruction, it is probable that the sacredness of the place may have
protected it so that the actual remains of some of the bodies
deposited there may yet be there, under Moslem guardianship.

After the birth of Isaac, Abraham remained in the region of


Gerar, whose precise location is not known, although it must have
been in the southwest of Canaan and in the land of the Philistines.
From thence he removed to Beersheba.55

BEERSHEBA AND GERAR.


31. Beersheba bears, at the present day, the same name and
contains two wells, one about 12 feet in diameter, the other about
5 feet. The larger appears to be very old and may well have existed
since the days of the patriarch. It is about 40 feet deep to the water
and is still used daily by the Arabs. The exact distance from Hebron
to Beersheba is twenty-six and a half miles southwest. There are
some ruins 24 miles southwest by south from Beersheba, called
Umel Jerar, which possibly may indicate where the ancient Gerar
was.

32. From Beersheba Abraham travelled with Isaac to Mt. Moriah,


which was at the present site of Jerusalem and distant in an air line
45 miles northeast. Here his obedience and faith were severely tried
in the command to offer up, as a burnt-offering, his only son Isaac.
This act might have been more trying to the faith of Abraham
because it was the practice of the Canaanites at that time. That the
immolation of children was practised by the Phœnicians at that age
and in the land of Chaldæa is proved by an Accadian text which
expressly states that sin may be expiated by the vicarious sacrifice of
the eldest son.56 In after times it was practised by the Moabites,
2 Kings 3:27. But Abraham’s faith never failed him, and the offering
was accepted, though the act was arrested.

33. Abraham after this purchased the cave of Machpelah, of


which we have spoken, where Sarah was buried, and he himself was
laid away in the same place at his death, having given all his
possessions to his son Isaac, except some smaller gifts to his other
children by his second wife Keturah, when he sent them away from
Isaac his son “unto the east country.”

34. The character of Abraham has been revered among the


Jews, Mohammedans, and Christians alike in all ages and parts of
the world. His tomb now existing at Hebron is among the very few
places in the East about which there has never been any doubt. The
structure, now a mosque, is a Mohammedan addition to a building
which was in part erected near the beginning of the Christian era.
CHAPTER VI.
THE PATRIARCHS ISAAC AND
JACOB.
1. Isaac, as appears from sacred history, towards the close of his
father’s life, dwelt in the “south country,” a term given to the large
district far to the south of Hebron, where also Abraham was
probably living at the same time.

The exact place called Beer-lahai-roi, or “the spring of Lahai-


roi,” is not known, but it was that spring, called a “well,” which was
mentioned in connection with the first departure of Hagar, and it was
evidently on the way towards Egypt, between Kadesh and Bered,
some thirty miles nearly south of Beersheba.

2. The pastures were excellent here, and Isaac, now about


40 years of age, had come into possession of large herds whose care
devolved upon him. It was here that he received his wife, whom his
father Abraham had selected for him from among his kindred in the
far-off land of Mesopotamia in preference to the people of the land
where he dwelt, who were Hittites, and descendants of Canaan the
son of Ham, Abraham being a descendant of Shem. The Philistines
who dwelt on the southwest coast of Canaan and of whom the
Abimelech of the text was king, were formerly a mixed race. In this
age they are considered to be the immediate descendants of a tribe
which took possession of the dry, salt region stretching from the
Delta of the Nile on the coast around towards Canaan. Here, in early
times, they became the great salt producers and of great importance
to the salt fisheries which supplied various surrounding countries.
The Mt. Casios in their territory was the “Kas-lokh,” or “dry” “burnt
up hill” of the ancient Egyptians, hence the name of Casluhim, of the
Hebrew text, as that of the people from whom the Philistines were
derived, Gen. 10:14.

3. They seem many years before to have left the Phœnician


shores and settled near the coast of the Egyptian Delta. Thence they
moved to the salt regions, but they adapted themselves fully to the
Egyptian method of life and literature, as appears from their history
gathered from the ancient records. These records have fully
corroborated the statement of Genesis.57

4. In the time of Abram they had taken possession of the


southwestern part of Palestine and had largely modified their habits
of life. They are represented on the monuments of Egypt as fine-
looking warriors, wearing a head-dress of peculiar and very
ornamental form, with the back of the neck protected, and when
marching, moving in great order, using the javelin and the short
sword for close combat.

5. At this time, about B. C. 1800, the Philistines had not arrived


at that condition of power and wealth which they possessed in later
centuries. They afterward became most formidable enemies of the
Israelites, and possessed at least five grand cities. In this era of their
history Gerar seems to be the residence of the king, Abimelech, as it
was of his father of the same name in the time of Abraham, 90 years
before. Being a small tribe, its king was anxious to form an alliance
with Isaac, whose household and possessions had become very
great, and, judging from the context, his retinue of servants and his
wealth exceeded all that Abraham had possessed before him.

6. There are, at present, two wells at Beersheba of the same


general architecture, and both seem to be very ancient. The one
about 300 feet off from the large one, spoken of before, is only
about five feet in diameter. As the men of Gerar, at Abraham’s death,
filled up “all the wells” built by the patriarch, it is probable that the
second well was dug by the servants of Isaac and called also
Beersheba as commemorative of the second oath of treaty made by
Abimelech, the second of that same name mentioned in Scripture,
and his commander-in-chief, as Phicol means.

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.

In that act of deceit he was aided by his mother, who probably


never lived to see again the son she loved so much. Jacob returned
not for many years, although when his mother parted with him she
supposed it was for “a few days,” Gen. 27:44. He returned to Hebron
shortly before the death of his father, in whose burial, in the cave of
Machpelah, both his sons, Esau and Jacob, united, Gen. 35:29.

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.

Joseph, the son of Jacob’s old age, because of jealousy on the


part of his brethren, was sold by them to a party of trading
merchants, called “Ishmaelites.” These “came from Gilead, with
their camels bearing spicery and balm and myrrh, going to carry it
down to 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.

Dothan was a Canaanitish town about five miles southwest of the


Carmel range of mountains and thirteen miles north of Shechem. It
was fully 900 feet above the sea, and on the south of a beautiful
plain five miles long and two wide.

9. The Ishmaelites sold Joseph in Egypt, where, through his


ability to interpret the dream of Pharaoh, he became, under the
king, the second ruler of Egypt and prepared for the seven years of
famine which were preceded by seven years of extraordinary
harvests. The famine in Egypt was attended by famine in Canaan, as
also in other lands. This condition of famine caused Jacob to send
his sons into Egypt for corn. It should be remembered that in these
countries the word “corn” was applied to almost any kind of grain,
but especially to wheat and barley, as indeed it is at the present day
in several other countries. It is not probable that Indian maize, called
corn in our land, was ever referred to in Scripture.

At the second visit of the patriarch’s sons, Joseph, who recognized


them at the first visit, made himself known unto them and sent them
back with the direction to bring his father, and all that made up the
entire family, into Egypt.

10. After some hesitation on the part of Jacob, he left Hebron,


and passing through Beersheba, started on his way to Egypt, where
he arrived and was met by Joseph, on the plains of Goshen. Recent
discovery has located this region about 40 miles northeast of the
present Cairo, in its central point, with a diameter of about
15 miles.58
Jacob was introduced to the reigning Pharaoh when he was
130 years of age. His interview was followed by the settlement of
the entire family, with all their herds and possessions, in the district
above mentioned. This was a small district included in a much larger
one called, in after times, the land of Rameses, which name had
reference to a second king of that name, Rameses II., who was the
great builder monarch, and who lived not long before the time of the
Exodus. He died when Moses was 80 years of age.

[The student of Biblical chronology should use considerable caution in


accepting the dates and surmises offered by some writers in connection
with this history. The ages already given us in the text, namely, 130 for
Jacob when Joseph was 39 by the texts preceding, show that Jacob was
91 years of age at Joseph’s birth, but by Gen. 31:38 he had been at least
14 years with Laban, in Mesopotamia, just preceding the birth of Joseph.
So that 14 years before the birth of Joseph he left his home for Haran, at
the age of 77. It seems somewhat probable that Jacob was 40 years in
Haran, and that he means to make that assertion when, in
Gen. 31:38, 41, he separates the two 20 years. This affords more time for
his sons to grow to the ages of that manhood necessary for the after
occurrences narrated in the history. For the eldest, Reuben and Simeon,
were born not until the marriage with Leah, and this appears to have
been only seven years before the birth of Joseph. Six years after the birth
of Joseph, Jacob leaves with all his family for Shechem, where he remains
eight years. It appears, therefore, that Simeon and Levi, when they
attacked and overthrew Shechem and sacked the town, were not over 19
or 20 years of age, as six of the last years and re-engagement for six
years in Mesopotamia, and eight in Shechem, and perhaps a year on the
travel, and various stoppages, give grounds for that supposition, if Jacob
was only 20 years with Laban. It would then be as follows, remembering
that Reuben was the first-born of the sons of Jacob:

8th year. Reuben born first year after Jacob’s marriage.

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.

When Jacob arrived in Shechem he bought land, dug a well, and is


considered as resident for eight years.

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.

In the above calculation it is not necessary to suppose that Jacob was


any longer than 20 years engaged with Laban. It is impossible to suppose,
with some writers, that Jacob was only 40 years of age when he left his
home for Haran.]

11. Jacob, having had the land of Goshen, in Egypt, appointed


him, remained there until his death at 147 years of age, having
dwelt in the land of Egypt 17 years.

As Joseph died at 110 years of age, he lived 56 years after the


death of Jacob, as governor of Egypt, very probably, since the last
account of him was that “they embalmed him and he was put in a
coffin in Egypt.” He lived to see his great grandchildren, and
therefore was prominent in Egypt for a term of 80 years.
CHAPTER VII.
EGYPTIAN TESTIMONIES.
The recovery of the meaning of the Egyptian hieroglyphics,
and the many discoveries of monuments illustrating the early history
and literature of that nation, have added great interest to the study
of Scripture and established the accuracy of Biblical accounts of this
period.

1. The articles which the Ishmaelites carried to Egypt at the time


Joseph was sold are, in part, recorded in a list upon one of the
tablets at Edfu, on the Nile. The first and second of the articles
named in Gen. 37:25 are recorded by name, the article rendered
“spicery” being the name of a gum found in Syria.

2. The price of a common slave of Joseph’s age is recorded in


the time of Rameses XIII. as about $10. This agrees with the
statement, Gen. 37:28, where it is stated that Joseph was sold for
twenty pieces of silver, shown to be shekels of about 50 to 56 cents’
value, which was high, but Egyptian records show that young men
from Syria were unusually valuable.59

3. The existence of slavery is frequently alluded to upon the


monuments and in manuscripts, wherein those who had lost slaves
offer rewards to any one who will bring them back. Moreover, Syrian
slaves are recorded as of great value, and a treaty record is still
preserved, made between Rameses II. and the king of the Hittites,
in which it is agreed to return fugitive slaves.

4. The statement has been made by several Greek historians


that the Egyptians never cultivated the grape nor drank wine.
Therefore the statement that Pharaoh drank the juice of the grapes,
or wine, and had a chief butler, as stated in Gen. 40, was said to be
inaccurate. But the discoveries show that not only were vineyards
cultivated, but the grapes were pressed in the wine-press, grapes
were eaten, and wine made and used before the time of Joseph.

5. Various terms as descriptive of official position, of names of


places and objects of art or commerce, are now shown to be of
ancient Egyptian origin, although brought into the Hebrew language.
The use of these terms and names proves that the early Israelites
were in familiar contact with the Egyptians.

6. The name of Rameses, used in the history of Joseph, as


afterward in the history of the Israelites, has been shown to be that
of the chief Pharaoh of Egypt, and his mummy has recently been
recovered with his name and titles inscribed upon his body, and
certified to by the high-priest.

7. The singular remark made by the writer of Genesis


concerning the shepherds, 46:34, has been thoroughly attested by
the history of the incursion of the Shepherd Kings, who oppressed
the land, seized upon the government in the Delta, and drove the
native kings up the Nile to Thebes, occupying and ruling the land for
about 500 years. It was at the close of their rule that Joseph is
supposed to have entered Egypt.

8. The keeping of the birthday of Pharaoh as stated in


Gen. 40:20 is fully attested in the history of the early Egyptian
periods. An inscription of the era of the Exodus tells us that the
birthday of Rameses II. “caused joy in heaven.”60 Great gatherings
and feasts were had, and the king dispensed his favors as he saw
fit.61

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.

10. The statement as to the offices of chief butler and chief


baker, as appointed to the Pharaoh, is remarkably attested by the
Egyptian records, which show that these two were very high and
important offices, “for both had the responsible duty of protecting
the king’s life from poison.”62

11. A most remarkable illustration of the accuracy of Joseph’s


history, as narrated in Genesis, is seen in the statement that he was
required to change his clothes and be shaven before going into the
presence of the king. Among the kindred of Joseph shaving was
never practised, except as a disgrace. But with the Egyptian the law
of cleanliness required shaving, not only of the chin, but of the hair
also. Not only every priest, but the king himself, was shaven, and
the appearance of great heads of hair, and even of beard, in some
pictures is due to the wigs and artificial beards worn by priests and
laymen alike to cover the bald head. All foreigners were known by
being unshorn.

The accuracy of Scripture in its references to the land of Egypt in


ancient times has been proved only since the discovery of the
meaning of the hieroglyphics, as Greek historians knew little of
Egypt in its ancient history, and their accounts were erroneous, as is
frequently apparent in Herodotus.63
PERIOD III.
THE THEOCRACY TO
THE JUDGES.

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.

3. As we have said, the Shepherd Kings ruled Egypt for about


500 years. Towards the close of their rule and, as it is generally
supposed, under a king whose name is recorded as Apopi, or, as the
Greek historians spell the name, Aphobis, Joseph came into Egypt,
and the long war between the legitimate kings and the uprising
rulers was continued for about 80 years.

Finally these Shepherd Kings were driven out of the Delta by a


Pharaoh of the 18th dynasty,64 and from that period about 400 years
transpired, during which the 18th dynasty passed away and a new
dynasty, the 19th, came into power. Of this 19th dynasty two kings
passed away before the celebrated Seti I. began to reign.
Rameses II. was the son of Seti I., and his reign (67 years) was the
longest of any of this dynasty.

4. Moses, at the age of forty, was driven into the desert of


Sinai, on the east of Egypt, where he escaped from the wrath of the
reigning Pharaoh, and where he remained 40 years, until the death
of the king. The Pharaoh with whom Moses’ name is thus associated
must have reigned a long time, and the reign of Rameses II. meets
the conditions of the history, not only as to time, but also as to the
name. It is for these reasons that the Egyptian Rameses II. is
supposed to be the Pharaoh alluded to in the first chapter of the
book of Exodus, as the Scripture Rameses.
5. After the death of Rameses, Moses returned to Egypt from
his 40 years’ residence in the desert of Sinai. As his life in those
parts was spent in the shepherd occupation, he was well acquainted
with the region, and in a large degree fitted for the work to which he
was called by the Lord, to take charge of the deliverance of the
Israelites from the bondage in Egypt.

By divine command he appeared before the reigning Pharaoh and


demanded, in the name of Jehovah, the release of his brethren,
who, in all, must have been about 2,000,000. This number, though
not stated, may be supposed to be correct as based upon the fact
that at the departure from Egypt the able men numbered 600,000.

6. The unwillingness of the king to let the people go was


finally subdued by a series of remarkable plagues. The most singular
feature of these inflictions is found in the fact that in every case they
seem to have attacked the Egyptians in the most important elements
of either their national greatness or in the direction of their greatest
comforts and reliance. Another singular feature in the whole course
of affliction was their progressive seriousness.

7. The first plague appeared in the sudden change of the waters


of the Nile into blood. The Nile was not only the great source of
water supply, but was supposed to be under the immediate care of
the gods of Egypt. Hymns have come down to us composed in the
honor of the personified Nile. These were composed before the time
of Moses, and give the names of their chief gods to the waters of
the great river. The Nile was “the representative of all that was
good.” This plague made it necessary that the people should begin
digging wells near the banks of the river and elsewhere throughout
all Egypt.

8. The second plague, of frogs, attacked in like manner, but


more directly, the religious superstitions. The frog-headed deity Heki
was the wife of the god of the cataracts of the Nile, who also was
represented with a frog’s head. The frog was the symbol of renewed
life after death, and was worshipped as such.

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.

10. The fourth plague, of flies, was somewhat similar, being an


insect curse, but now the curse was winged.

11. The fifth plague, of “murrain,” was far more serious, as it


not only touched the honor of the Egyptian faith in the worship of
Isis and Osiris, to whom the cattle were sacred, but caused the
death of the cattle throughout Egypt. It troubled in yet more serious
degree the temple and the market, the priest and the people.

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.

14. The eighth was a terrific visitation of locusts which began, in


unprecedented numbers, to eat up all vegetation left by the hail.

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.

The Exodus, or the “departure,” began immediately, and Moses


and Aaron, who had anticipated the result of this last plague, had
prepared all the Israelites by giving them sufficient notice for a
hurried flight.
CHAPTER II.
THE PHYSICAL GEOGRAPHY OF
SINAI AND THE DESERT.
1. It is necessary that we should obtain a general knowledge of
the country over which the Israelites were now to travel. The land of
Goshen, where the great majority of the Israelites were stationed,
was included, probably, in the greater district of Rameses, as we
have said. They left some general rendezvous early in the morning
for Succoth, which was twenty or twenty-five miles southeast of the
district of Goshen. The treasure city Pithom, mentioned with
Rameses in the first chapter of Exodus (verse 11), was in Succoth,
as a recent discovery has shown. The west arm of the Red Sea was
about sixty miles farther south. The triangular district of the country
between the two northern arms of the Red Sea, to which they were
going, is a mountainous tract gradually ascending from the Gulf of
Suez, or western arm, to the mountainous region of Horeb, of which
Sinai was a chief mountain.65 These mountains are entirely of
granite. The large plain at the base of Sinai is 400 feet above the
sea. The Sinai mountain seems to rise directly up from this plain to
the height of from 1,200 to 1,500 feet, and in some parts, at its
base, the rock is for a long distance almost perpendicular, like a high
bluff above the level soil. Parts of the rocky heights are 2,000 feet
above the plain.
2. North of this region, about 50 miles, a sandy stretch of
country comes abruptly to a general rise of sandstone cliffs, which
extend many miles east and west, and the granite rocks disappear,
having been left behind in Horeb.

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.

THE ISRAELITES IN THE DESERT.


3. The recent discovery of Succoth and the treasure city
Pithom fixes this place as that of the first encampment of the
Israelites at the Exodus. One inscription calls the place Petum (the
“abode” of Tum) in the city of Thuku, or “Pithom in the city of
Succoth.”

The great desert now begins, stretching eastward from Succoth


for about 200 miles, a very desolate and barren region, to the
country of Edom and the great valley of Arabah, which valley runs
northward directly from the eastern arm of the Red Sea to the Dead
Sea, a distance of 115 miles. The chief divine object in directing the
course of the Israelites southeast from Egypt to the region of Horeb
and then around by the Gulf of Akabah, rather than by the short
course to Canaan by the coast, is expressed in the Scripture, and
was one of discipline, Exod. 13:17, and preparation for the new life
they were destined to live.

4. Many misapprehensions of the real difficulty of this long


travel have resulted from a failure to comprehend the largeness of
the company. It must be remembered that so large a number as
2,000,000 people, with their herds and flocks, their tents, the
Tabernacle, and other baggage, must have covered a much larger
space than is sometimes allowed by some readers of this history.
Thus in crossing the Red Sea and stopping at stations and fording
the Jordan on their arrival at Canaan, and in settling upon plains,
before and after, it must be always kept in mind that no narrow line
or small surface less than several square miles would in any way
represent that necessary area over which the moving body travelled,
or rested when it came to a halt. In its course at evening the
advanced officers would soon lay out upon the area to be occupied
the plan for encampment, and in a short time that space of land,
which an hour before was the prowling-ground for a few wild beasts
of the desert, would become the site of a city of 2,000,000
inhabitants, with long streets and squares lighted with the
magnificent and mysterious flame which accompanied them during
all their wanderings.

5. The habits of eating and drinking in that day were very


different from anything now customary in our midst. The plainest
food, and frequently only one meal a day and one draught of water
in 24 hours, is sufficient for the Bedouin of the desert. We are
therefore wrong in comparing the habits of the times of the Exodus
with those of the present day.

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.

There is evidence that anciently a great population was scattered


over this region of Ain Gadis, and considerable verdure exists even
at present. This appears to have been the general camping-ground
of the Israelites for a large part of the thirty-seven years before they
finally started to enter the promised land. The sad history of the
event which brought this long delay is recorded in Num. 14.
CHAPTER III.
THE ENTRANCE INTO CANAAN.
1. After the long residence in the region of Kadesh the
Israelites took up their march to Canaan. The generation now
existing had been almost altogether born in the desert, and had
been raised under the tutelage of Moses and his brother Aaron.
Miriam, the sister, had undoubtedly added much to the influence
which her brothers exerted by her nearer relation to the female
population. The discipline had had its full effect during this long
period, and there had grown up a vigorous and well-ordered race,
totally different from the race that had left Egypt forty years before.

2. It is probable that during this long period Moses had


written out much, if not all, of the Scriptures usually attributed to
him under the title of “the books of Moses.” Although there is no
definite statement in Scripture that all of these books, called the
Pentateuch, are the composition of Moses, certain parts are spoken
of as those of his personal writing. But of the five books the parts
spoken of are only in the closing chapters of the last book, namely,
Deuteronomy, and as the five have never been known except as
forming one roll or volume, the general belief and tradition attribute
the whole five to Moses as author. The impression that Moses was
the author of Genesis, and that this book of Genesis was the
beginning of “The Law,” is apparent in the writings of Longinus, the
Greek author, A. D. 270, who quotes Gen. 1:3 as “the beginning of
Moses’ law.”66
3. The census of the nation at this time shows that nearly
2,000 men had disappeared, and perhaps this lessening of the
population was due to the deaths of the strangers and aliens who
had become mixed in the vast crowd at the time of their departure
from Egypt.

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.

4. Moses died upon Mt. Pisgah without crossing the Jordan,


Aaron died on Mt. Hor, and Miriam died at Kadesh. These leaders
being dead, the authority to take charge was vested in Joshua.

MT. HOR, MT. NEBO, MT. PISGAH.


5. Mt. Hor is 45 miles south of the Dead Sea, having the ruins of
the city Petra near its eastern base. Wandering Arab tribes control all
access to these two places, but a small chapel marks the spot,
according to tradition, where Aaron died on the top of the mountain.

Pisgah is supposed to be a high plateau ten miles east of the


mouth of the Jordan, and Mt. Nebo a higher portion of the same
general range, but it is at a short distance east of that part where
the high table-land of Moab begins to descend to the Dead Sea.
From this elevation very extensive views of the land west of the
Jordan may be had.

THE ERA OF JOSHUA.


6. From the high table-land of Moab the Israelites descended
to the eastern Jordan plains a few miles north of the Dead Sea, and
soon crossed the river and landed upon the wide plain west of the
banks. The crossing must have occupied the bed of the river for a
long distance.

On entrance upon the land of Canaan proper the hosts of Israel


renewedly consecrated themselves to the service of Jehovah at
Gilgal. They accepted Joshua as their commander, and began their
first attempt at subduing the Canaanites by an attack on Jericho.

GILGAL AND JERICHO.


7. The first of these names represents simply a gathering-place
of the Israelites when the dedication of themselves to the Lord took
place. Its position is supposed to have been at a place still called
Gilgal, in the Arabic Jiljulieh, nearly three miles west of the Jordan
and six miles north-northwest of its mouth. Jericho at this time was
near the present Ain es Sultan, a very fine spring one and a quarter
miles northwest from the present little Arab village called Er Riha or
Jericho by travellers, and five miles west of the river. After its
destruction at this time it was rebuilt B. C. 918, 1 Kin. 16:34, at the
mouth of the valley of the Kelt, which is the ancient valley of Achor,
and existed at that place in the time of our Saviour. The present
miserable Arab village Er Riha and the tower near it were built
during the crusades.

The name Gilgal signifies a “rolling” and also a “circle,” and


probably the twelve stones taken from the bed of the Jordan were
placed in the form of a circle, making the real significance more
emphatic, but the true significance of the name is given in the
passage, Josh. 5:9, as a rolling off “the reproach of Egypt,” as
described in that chapter. There were two other towns bearing this
name of which mention is made hereafter.

THE SETTLEMENT IN CANAAN.


8. Jericho was inhabited at this time by a luxurious people and
one that evidently had profited greatly by the richness of the vast
plain of the Jordan. The mention of the precious metals, “the silver
and gold and vessels of brass and iron,” Josh. 6:19, the “goodly
Babylonish garment,” the 200 shekels of silver, the wedge of gold of
50 shekels’ weight stolen by Achan, Josh. 7:21, and the references
to Baal-peor in the historic connection, prove their wealth and
suggest the nature of their idolatry. Recent historic discoveries show
the cruelty and fearful depravity of the people with whom they were
associated. They were therefore given over to destruction in
accordance with the customs of that time.

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.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like