Imports System. Data
Imports System. The Data. SqlClient
Public Class DatasetExample
Dim objConnection As New SqlConnection (" server=IDEA - PC; The database=pubs; User id=sa; Password=SQL2014wrox ")
Dim objDataAdapter As New SqlDataAdapter ()
Dim objDataset As New DataSet ()
Private Sub DatasetExample_Load (sender As Object, As EventArgs e) Handles Me. The Load
ObjDataAdapter. SelectCommand=New SqlCommand ()
ObjDataAdapter. SelectCommand. Connection=objConnection
ObjDataAdapter.SelectCommand.Com mandText=
SELECT "au_lname au_fname, title, price" & amp;
"FROM the authors" & amp;
"JOIN titleauthor ON the authors. Au_id=titleauthor. Au_id" & amp;
"JOIN titles ON titleauthor. Title_id=titles. Title_id" & amp;
The ORDER BY "au_lname au_fname"
ObjDataAdapter.SelectCommand.Com mandType=CommandType. Text
ObjConnection. The Open ()
ObjDataAdapter. The Fill (objDataset, "the authors")
ObjConnection. Close ()
GrdAuthorTitles. AutoGenerateColumns=True
GrdAuthorTitles. The DataSource=objDataset
GrdAuthorTitles. DataMember="the authors"
ObjDataAdapter=Nothing
ObjConnection=Nothing
End Sub
The End of the Class
Run the above code objDataAdapter. The Fill (objDataset, "the authors")
Populated place error, database on the local computer, strives for the great god answers