Although you will create your databases as SQL files,
to provide a friendlier environment, you will create forms and other
graphical accessories that allow the users to access and view information.
In Visual Studio, you would create a Windows application.

ADO.NET provides various ways to connect to a
database, the simplest consists of using a SqlDataAdapter variable because
this gives you direct access to the SQL Server database. With other
techniques, or as traditionally done, you would have to create an ODBC
Data Source. The Microsoft Visual Studio .NET programming environment is
so close to SQL Server that you can create and manage a database as if you
were using a single application to take care of this.

From the Server Explorer, expand the Servers node, the server that
holds your SQL Server Installation, the SQL Servers node, and the name
of the server you will be using

Expand the BCR1 node and expand the Tables node

Drag the CompanyAssets table and drop
it on the form. You will receive a dialog box

(Eventually, we will how to correct both warnings). Click OK

Introduction to Data Sets

The information stored in an object such as a database
table is called a set, which is simply the group of its records. Because
information is in fact referred to as data, the group of records in a
table is also called a data set. To identify and manage the set of
records, or data set, of a table, the Microsoft .NET Framework provides a
class called DataSet.

After getting a connection to a database, you are
ready to process it. You can use the data directly or, to better manage
it, you can pass it to DataSet variable.

Practical
Learning: Creating a Data Set

Right- click the sqlDataAdapter1 icon in the lower section of the
form and click Generate Dataset...

Click the text box to the right of the New radio button and change
it to dsCompAssets

Click OK

The DataGrid Control

Data of a table is represented as a series of columns
and rows. The columns are horizontal and hold the categories of
information. A row contains entries various columns. The intersection of a
column and a row is called a cell. The group of values stored in cells of
a particular row is called a record.

To display information of a table, in the Server
Explorer, you can just double-click it.

Instead of using a table to display data in cells, the
Microsoft .NET Framework provides a control called DataGrid. This
object also organizes its information in series of columns and rows whose
intersections, called cells, hold the data of a table. To use a DataGrid,
click it in the Toolbox and click the form. After doing this, you can
specify that the information that displays in the cells will come from a DataSet.
To do this, you can set the DataSource property of the DataGrid
to the DataSet you have created. To actually display data in the DataGrid,
you can call the Fill() method of the data adapter you are using.

Practical
Learning: Display Data in a Data Grid

On the Windows Forms section of the Toolbox, click DataGrid and
click the form

Position the DataGrid to the top-left corner and enlarge it

Right-click the DataGrid and click Auto Format

In the Formats list, click Colorful 3

Click OK

On the form, click the DataGrid to make it is selected. In the
Properties windows, change the following properties:
CaptionText: Company Assets Distributed to Employees
DataSource: dsCompAssets1.CompanyAssets
Anchor: Top, Bottom, Left, Right

Double-click an unoccupied area of the form to generate its Load
event