CS 112D Lecture Notes - Database Basics with VB.NET (Chapter 1) - Craig Persiko

SQL Server Data Types

The data types used in SQL Server have different names than in Access or VB. Here are the most important ones for us:

Building a Database in Visual Studio .NET

Database Concept Review

Using VB.NET to connect to a database

Modifying Records using Data-Aware Controls

VB Syntax Note: With ... End With blocks

When you're calling a lot of methods of a particular object, you can use a With ... End With block to specify set a default object for all method calls. Here is an example. The following code will delete the current record from a DataSet from the Customer table:

Me.BindingContext(DsCustomer1, "tblCustomer").RemoveAt(Me.BindingContext(DsCustomer1, "tblCustomer").Position)

And here is the same code using a With...End With block:

With Me.BindingContext(DsCustomer1, "tblCustomer")
End With

Validating Data Entry

Return to the main CS 112D page