Even though the database has been created and is part of your project, it's still not a data source to VB.NET. Fortunately, there's a wizard for that too. Under the Data menu, click Add Data Source to start the wizard. Select Database as the source type and click Next. You shouldn't have to do anything except click Next on the Choose Your Data Connection step. In Choose Your Database Objects, click the checkbox for the WineList table to select all the columns. Click Finish to add your database as a data source. Open the Show Data Sources window under the Data menu to see the data source.
Displaying the WineList Data
Microsoft is building 'drag and drop' programming all the time and you can see a great example right here. Display the form for the project along with the Data Source window and you can drag a column onto the form and drop it. VB.NET writes all the code to access the column for you!
--------
Click Here to display the illustration
Click the Back button on your browser to return
--------
Drag all of the columns to the form, and you have the technical part of your program done.
If you want to know how the wizard does the trick, click the Show All Files icon in Solution Explorer and browse the .vb files there.
--------
Click Here to display the illustration
Click the Back button on your browser to return
--------
A little more about relational databases
The word relational means that the tables are related to each other using key values. One classic example that you see in a lot of training is a "company" that has many "employees". Lets see how this two-table database relates.
If the "company" is just a branch of many (like, for example, Starbucks) then each one will probably have a unique CompanyID code. That can be used as the "key" for the "company" table. The "company" table will also have a lot of data fields (usually called "columns") like Name, PrincipalAddress, CentralPhoneNumber and so forth. The "employee" table might have an "EmployeeID" key and columns like EmployeeName, JobTitle, and so forth. The relationship between the "company" table and the "employee" table will be one-to-many. That is, one company will have many employees. And the "employee" table will have one field, called a foreign key, that is used to establish that relationship. In the "employee" table, a field, usually named the same as the one in the "company" table and in this case CompanyID, will be the same as the key in one row of the "company" table. This establishes the relationship and tells a program which company the employee works for.
--------
Click Here to display the illustration
Click the Back button on your browser to return
--------
What is this CRUD?
You might see the acronym CRUD as you learn about databases. It refers to the four operations that can be done on databases: Create, Retrieve, Update and Delete. And you might also see DDL and DML. These acronyms refer to Data Definition Language and Data Manipulation Language. These are parts of SQL (T-SQL in the Microsoft world). DDL is used to create the actual databases and tables themselves. DML is used to read and update the data in them. The Select statement shown earlier is DML.
Another type of T-SQL called DCL or Data Control Language. This is almost always done by administrators rather than programmers since it's used primarily for security.
Since there are other ways to create the databases and tables and also since it tends to be a job turned over to specialists, especially in big shops, you might never actually use DDL or DCL, but your programs will be filled with DML. DML consists of the four operations, SELECT, INSERT, UPDATE and DELETE.

