Learn your way! Get started

ADO.NET Using Visual Basic 2005

with experts Andy Baron, Ken Getz


Course at a glance

Included in these subscriptions:

  • Dev & IT Pro Video
  • Dev & IT Pro Power Pack
  • Power Pack Plus

Release date Release date 10/24/2006
Level Level Advanced
Runtime Runtime 14h 8m
Closed captioning Closed captioning N/A
Transcript Transcript N/A
eBooks / courseware eBooks / courseware Included
Hands-on labs Hands-on labs Included
Sample code Sample code Included
Exams Exams Included
Platform Platform Internet Explorer Only


Enterprise Solutions
Enterprise Solutions

Need reporting, custom learning tracks, or SCORM? Learn More



Course description

In this course, learn about the features provided by ADO.NET 2.0. Learn to connect to data sources, retrieve and manipulate data, and perform data updates. Examine the various ADO.NET classes, including Connection, Command, DataReader, DataSet, DataTable, DataRelation, and more. See how to apply constraints and relationships to disconnected data. Learn how to update data, including how to handle stored procedures, parameters, and return values. Understand how to search, sort, and filter data stored in a DataSet or DataTable. Become familiar with strongly typed DataSets and learn their advantages. See how to leverage the power of XML through serialization, Diffgrams,and the XMLDataDocument object. Examine new ADO.NET features that support SQL Server 2005 technologies, including asynchronous commands, Multiple Active Result Sets, bulk inserts, and more.

Meet the experts

Andy Baron Andy Baron is a nationally recognized industry expert specializing in Visual Basic, Visual C#, ASP.NET, ADO.NET, SQL Server, and SQL Server Business Intelligence. He is an experienced consultant, author, and editor for several industry publications and speaker at industry conferences. Andy has also been repeatedly selected as a Microsoft MVP for his contributions to Microsoft's online support.

Ken Getz Ken Getz is a featured instructor for several of our Visual Studio courses. He is a Visual Basic and Visual C# expert and has been recognized multiple times as a Microsoft MVP. Ken is a seasoned instructor, successful consultant, and the author or co-author of several best-selling books. He is a frequent speaker at technical conferences like Tech-Ed, VSLive, and DevConnections and he has written for several of the industry's most-respected publications including Visual Studio Magazine, CoDe Magazine, and MSDN Magazine.


Course outline



Module 1

Understand ADO.NET (35:18)
  • Introduction (02:05)
  • The Evolution of ADO.NET (13:12)
  • Benefits of ADO.NET (03:34)
  • ADO.NET Object Model (01:12)
  • .NET Data Provider Objects (01:37)
  • Connected Provider Objects (02:13)
  • Data-Caching Objects (08:04)
  • Understanding DataAdapters (01:49)
  • Putting it all Together (00:33)
  • Summary (00:57)
Connect to Data (28:47)
  • Introduction (00:58)
  • Course Sample Details (00:48)
  • Overview: app.config (00:42)
  • Overview: Connection Settings (02:59)
  • Create Main Project Forms (01:35)
  • Overview: Sample Database (00:54)
  • Connection String Builder (06:42)
  • Demo: Connect to SQL Server (02:21)
  • Demo: Connect to Access (03:07)
  • Code: Connect to SQL Server (04:54)
  • Track State Changes (01:21)
  • Code: Connect to Access (01:35)
  • Summary (00:46)
Pooling and Statistics (20:30)
  • Introduction (00:46)
  • Overview: Connection Pooling (06:22)
  • SqlConnection Pooling Props. (05:40)
  • Conn. Pool Monitoring Tools (02:23)
  • Connection Pooling Stats (04:27)
  • Summary (00:50)

Module 2

Beg. Commands/DataReaders (37:54)
  • Introduction (00:44)
  • Overview: Command Classes (02:29)
  • Create Command Objects (00:34)
  • Create Cmd. Constructors (03:10)
  • Retrieve Connection Info. (03:53)
  • Command Object Methods (00:43)
  • Query Returning No Rows (01:24)
  • Execute a DML Query (00:30)
  • Execute a DDL Query (00:20)
  • ExecuteNonQuery Method (05:01)
  • Results from Running Query (00:59)
  • Close Conns. Automatically (01:32)
  • ExecuteReader Method (04:07)
  • Query Returning Single Value (01:00)
  • Demo: ExecuteScalar Method (01:58)
  • Retrieve Results Faster (01:14)
  • Retrieve Data w/DataReaders (06:40)
  • Summary (01:27)
Adv. Commands/DataReaders (38:10)
  • Introduction (00:39)
  • Retrieve Multiple Result Sets (03:12)
  • Retrieve Schema Information (03:57)
  • DataReaders Block Conns. (01:30)
  • DataReader over DataTable (01:30)
  • DataTableReader Object (03:14)
  • Call Stored Proc./Saved Query (00:51)
  • Query with No Parameters (01:05)
  • Passing Parameters (01:19)
  • Using Parameters (00:56)
  • SQL Ad Hoc w/Params (01:57)
  • OLE Db Ad Hoc w/Params (01:41)
  • Stored Proc w/Output Param (03:05)
  • Manage Multiple Namespaces (00:21)
  • Multiple Providers (00:26)
  • Using Inheritance (00:59)
  • Create Command Method (03:05)
  • Data Binding in ASP.NET (06:07)
  • Summary (02:08)

Module 3

Populate DataSets/DataTables (25:10)
  • Introduction (01:21)
  • Explore DataSets/DataTables (01:49)
  • Populate a DataTable (01:07)
  • Define Columns / Rows (02:05)
  • Fill Using a DataAdapter (03:01)
  • Dig into DataSets/DataTables (06:58)
  • Use the Load Method (04:37)
  • Handle Multiple Results (00:10)
  • Demo: FillAuto (00:46)
  • Fill Using Named DataTable (00:32)
  • Table and Column Mappings (01:34)
  • Summary (01:05)
Schema and XML (25:55)
  • Introduction (00:58)
  • Explore Schema Sample (06:24)
  • Explore XML Sample (04:10)
  • DataColumn Properties (03:45)
  • MissingSchemaAction (01:33)
  • Use FillSchema (01:18)
  • Work with XML Data (01:28)
  • Write XML to a File (01:27)
  • Read XML from a File (01:58)
  • Get XML Filename (00:31)
  • Display XML Data in IE (00:43)
  • Summary (01:34)
Prim. Key/Unique Constraints (19:37)
  • Introduction (01:04)
  • Explore the Sample (02:35)
  • Demo: Fill Multiple Times (01:43)
  • Demo: Unique Constraints (05:45)
  • Demo: Add a Primary Key (02:22)
  • Demo: Merge DataSets (03:24)
  • Demo: DataSets w/Prim. Key (01:53)
  • Summary (00:49)

Module 4

Foreign Key / Constraints (27:17)
  • Introduction (01:25)
  • Explore the Sample (02:33)
  • Setup Foreign Key Constraints (04:50)
  • Demo: Cascading Actions (03:41)
  • Cascading Actions Explained (06:55)
  • Other Constraints (01:56)
  • Disallow Nulls / MaxLength (05:05)
  • Summary (00:50)
Create DataRelations (17:56)
  • Introduction (02:02)
  • Relations in Databases (03:38)
  • Relations in ADO.NET (00:52)
  • Create Relations (02:58)
  • Create Relations w/Constraints (01:15)
  • Demo: Set Relations Code (03:38)
  • Relations and DataBinding (01:31)
  • Relations w/Constraints Code (00:36)
  • Summary (01:22)
Navigation Pathways (18:48)
  • Introduction (01:07)
  • Explore the Sample (01:21)
  • Demo: Fill the DataSet (01:48)
  • Demo: GetChildRows (02:51)
  • Demo: GetParentRow (01:36)
  • Expressions and Relations (01:15)
  • Aggregates / Lookups (03:40)
  • Specify XML Nesting (04:13)
  • Summary (00:53)
Create / Execute Commands (35:30)
  • Introduction (01:34)
  • Code: Grab the Sample Data (02:31)
  • Code: CommandBuilder (02:30)
  • Code: Update w/Cmd Builder (02:09)
  • Create / View Commands (04:13)
  • Overview: ConflictOption (02:30)
  • Update Data w/Cmd Builder (01:19)
  • Code: Custom Commands (03:56)
  • Create Custom Commands (01:00)
  • DataRowVersion (04:59)
  • RowState (03:57)
  • Accept / Reject Changes (01:22)
  • Code: GetChanges (02:38)
  • Summary (00:47)

Module 5

Work with Stored Procedures (34:32)
  • Introduction (01:04)
  • Advantages of Stored Procs (06:47)
  • Demo: View the Sample Form (00:58)
  • Create Stored Procedures (04:39)
  • Use Insert Stored Procedure (03:41)
  • Use AcceptChanges (00:56)
  • Use Delete Stored Procedure (03:05)
  • Demo: Use Stored Procedures (01:36)
  • Demo: Perform Batch Updates (03:57)
  • Perform Batch Updates (01:32)
  • Set UpdateBatchSize (00:23)
  • Set UpdatedRowSource (04:19)
  • Summary (01:29)
Intro to Typed Datasets (32:27)
  • Introduction (01:18)
  • Use Loosely Typed DataSet (01:02)
  • Standard DataSet Pitfalls (00:32)
  • A Better Way for DataSets (00:52)
  • Create Strongly Typed DataSet (01:01)
  • Create a Data Connection (02:43)
  • Intro. to the TableAdapter (00:20)
  • View the XSD File (01:10)
  • Investigate the New Class (00:48)
  • Use the Class View Window (03:04)
  • Write Code to Test DataSet (03:43)
  • Use a Strongly Typed DataSet (00:30)
  • Work with Untyped DataSet (01:58)
  • Work with Typed DataSet (02:30)
  • Work with Typed DataTable (01:21)
  • Review: Typed DataSet (00:31)
  • Review: TableAdapter (00:24)
  • Find Row in Typed DataSet (02:19)
  • Edit Row in Typed DataSet (01:55)
  • Add Row in Typed DataSet (02:42)
  • Summary (01:33)
Advanced Typed Datasets (38:00)
  • Introduction (01:11)
  • Work with Null Values (02:28)
  • Nav. Rels. in Typed DataSet (00:46)
  • Demo: Navigate Relations (04:22)
  • Create TableAdapter Queries (01:09)
  • Demo: TableAdapter Queries (04:47)
  • Issues w/Strongly Typed DS (00:33)
  • Typed DataSets/Data Binding (02:46)
  • Typed/Untyped DS Efficiency (04:53)
  • Convert Bet. Typed/Untyped (05:11)
  • Using Annotations (02:16)
  • Demo: Using Annotations (02:13)
  • Attrib. to Modify Class Names (03:34)
  • Summary (01:44)

Module 6

Structured Exception Handling (17:29)
  • Introduction (00:44)
  • Basic Exception Handling (02:21)
  • Simple Try/Catch (01:16)
  • Try/Catch/Finally (02:24)
  • No Error Handling (00:49)
  • Use the Exception Object (03:39)
  • Demo:Exception Sample (05:07)
  • Summary (01:04)
Data Errors/Transactions (35:57)
  • Introduction (01:04)
  • SqlException Severity Levels (02:58)
  • Handle Multiple Errors (05:00)
  • Handle Informational Errors (02:27)
  • Handle Multiple Severity Errors (00:49)
  • Demo: Handle Multiple Errors (00:27)
  • Handle InfoMessage Errors (00:17)
  • Errors and InfoMessages (00:35)
  • Demo: Using Transactions (06:09)
  • Update using Transaction (03:23)
  • Nested Exception Handling (02:50)
  • Transaction Isolation Levels (07:22)
  • Summary (02:31)
Handle Concurrency Errors (49:06)
  • Introduction (01:03)
  • Handle Optimistic Concurrency (01:56)
  • Use Update Criteria (04:28)
  • Demo: Run Scripts from VS (03:25)
  • Update w/Stored Procs (06:23)
  • Check Validations (01:22)
  • Perform the Update (00:23)
  • @@ERROR/@@ROWCOUNT (01:40)
  • Handle Concurrency Errors (02:52)
  • Try/Catch in SQL Server 2K5 (03:11)
  • SQL Server 2K5 Scripts (00:20)
  • Data Updates with ADO.NET (05:10)
  • Page_Load/Refresh Data (05:28)
  • Code for Updating Changes (00:09)
  • Code for Cancel Changes (04:17)
  • RowUpdated event (01:55)
  • Code for Concurrency Errors (03:53)
  • Summary (01:03)

Module 7

Search Data Tables (24:24)
  • Introduction (00:51)
  • Setup Sample Project (01:12)
  • MissingSchemaAction (01:36)
  • Work with Datatables (00:23)
  • Search Primary Key Values (00:45)
  • IndexOf Method (00:42)
  • Simple Dynamic Searches (01:02)
  • Search Primary Key Values (01:36)
  • Search Multi-Column Key (01:29)
  • Simple Dynamic Search (01:41)
  • Search with Wildcards (00:50)
  • Managing Delimiters (01:08)
  • Other DataTypes / Delimiters (00:19)
  • Demo: Manage Delimiters (02:56)
  • Additional Filter Issues (00:37)
  • Search with Row State (00:28)
  • Use DataViewRowState (02:26)
  • Demo: Search with Sort (01:18)
  • Search DataViewRowState (01:52)
  • Summary (01:04)
Search Data Views (31:42)
  • Introduction (00:55)
  • What is a DataView (00:40)
  • Create a DataView (00:32)
  • Sort Data in a DataView (00:47)
  • Demo: Sort Data (01:33)
  • Filter Data in a DataView (02:20)
  • Demo: Filter Data (01:40)
  • Demo: Filter on Row State (03:36)
  • Iterate through Rows (00:58)
  • Demo: Iterate through Rows (01:45)
  • Find Row in a DataView (01:08)
  • Find Multi. Rows in DataView (00:23)
  • Demo: Find a Row (02:42)
  • Demo: Find Multiple Rows (01:20)
  • Modifying Data in a DataView (00:37)
  • Add a New Row in a DataView (01:23)
  • Modify a Row in a DataView (01:40)
  • Delete a Row in a DataView (00:51)
  • Demo: Modify Data (02:02)
  • DataTable from DataView (01:04)
  • DataView.ToTable Method (01:46)
  • Summary (01:49)
Create AutoIncrement Cols. (30:25)
  • Introduction (02:21)
  • AutoIncrement Typed DataSet (00:34)
  • AutoIncrement Property (01:03)
  • AutoIncrement SQL Server (03:53)
  • AutoIncrement with Access (02:46)
  • Work with AutoIncrement (02:22)
  • Retrieve Database Values (01:22)
  • Use SCOPE_IDENTITY() (03:18)
  • Use the RowUpdated Event (06:47)
  • Reset Identity in Access/Jet (02:21)
  • Reset the SQL Server Identity (02:13)
  • Summary (01:20)

Module 8

Solve AutoIncrement Problems (19:04)
  • Introduction (00:51)
  • Issues with AutoIncrement (03:35)
  • AutoIncrement - No Conflicts (02:45)
  • Issues Merging Rows (03:04)
  • Merge Rows - No Conflicts (00:57)
  • Code: Fix Merge Rows Issue (05:30)
  • Summary (02:20)
ADO and XML (42:41)
  • Introduction (01:29)
  • DataSet vs DataTable (00:49)
  • Read and Write XML (00:14)
  • Visual Studio Tools for XML (03:24)
  • Work w/XML Programmatically (00:41)
  • ReadXml/WriteXml Methods (05:04)
  • Saving DataSet Data as XML (00:45)
  • GetXml Method (00:29)
  • Demo: GetXml Method (01:37)
  • DataSet XML Output Options (00:33)
  • WriteXml Method (01:23)
  • XML Output as a DiffGram (01:15)
  • Demo: WriteXml Method (04:52)
  • Demo: DataSet XML Options (02:57)
  • Demo: Setup Schema Options (02:47)
  • Demo: XML as a DiffGram (03:25)
  • Load XML Data into a DataSet (02:04)
  • Read XML - Infer Schema (01:08)
  • Read XML - Internal Schema (01:16)
  • Read XML - External Schema (01:13)
  • Read XML - DiffGram (01:57)
  • XML String to DataSet (01:23)
  • Summary (01:48)

Module 9

XML Data Document/Xquery (52:35)
  • Introduction (01:19)
  • DataSets and XML (01:07)
  • Use an XmlDataDocument (00:47)
  • Demo: Use XmlDataDocument (03:38)
  • View Full Input (00:23)
  • View Full Output (00:57)
  • Format XML Data with XSLT (00:50)
  • Demo: xsl Compiled Transform (04:57)
  • Query DataSet Data (00:59)
  • Demo: Query with XPath (05:51)
  • XML in SQL Server (02:46)
  • Using XQuery (02:25)
  • Conn. to AdventureWorks (00:57)
  • Demo: Retrieve Last Names (05:23)
  • Demo: Filter the Results (04:06)
  • XQuery and ADO.NET (00:31)
  • Demo: XQuery Queries (01:43)
  • Return Single Value (01:36)
  • XQuery u/value Method (01:58)
  • XQuery FLWOR Statements (01:23)
  • Demo: Use FLWOR to Filter (03:18)
  • Modify XML Data with Xquery (04:15)
  • Summary (01:15)
Asynchronous Processing (26:25)
  • Introduction (01:22)
  • Async Query Execution (04:59)
  • Async Completion Signaling (06:25)
  • Asynchronous Processing (01:39)
  • View Connection String (00:49)
  • View SQL Strings (01:07)
  • SqlCommands/WaitHandles (04:38)
  • Setup Asynchronous Loop (02:01)
  • Setup the Results Textbox (02:12)
  • Summary (01:08)

Module 10

Bulk Copy and Snapshot (34:30)
  • Introduction (00:34)
  • Bulk Copy Options (03:22)
  • Run Script to Create Table (01:54)
  • Using Bulk Copy to Load Data (01:36)
  • Code: Bulk Data Copy (02:58)
  • WriteToServer Method (01:52)
  • Code: Snapshot Isolation (01:09)
  • Pooling Set to False (01:43)
  • Enable Snapshot Isolation (02:55)
  • Transaction Isolation Levels (01:43)
  • Serializable (01:50)
  • Snapshot (03:54)
  • ReadCommitted (00:56)
  • ReadUncommitted (01:12)
  • Demo: Snapshot Isolation (02:38)
  • Summary (04:07)
Development Enhancements (47:39)
  • Introduction (00:30)
  • Enumerate SQL Servers (03:12)
  • MARS Scenarios and Caveats (06:58)
  • Mutliple Active Result Sets (07:49)
  • Demo: Max DataTypes (02:43)
  • Retrieve Max DataTypes (04:55)
  • Retrieve Text Values (02:33)
  • Enable Query Notifications (04:30)
  • Rules for Query Notifications (08:49)
  • Code: Query Notifications (03:13)
  • View Global.asax (01:15)
  • Summary (01:07)