Database Reference
In-Depth Information
Figure 14-7.
The Design view of the ResultSetInfo form
5.
Double-click the empty surface of the
TypedAccessor.cs
form, and it will open
the code editor window, showing the
TypedAccessor_Load
event. Modify the
TypedAccessor_Load
event to look like Listing 14-4.
Listing 14-4.
ResultSetInfo.cs
Using System.Data.SqlClient;
private void ResultSetInfo_Load(object sender, EventArgs e)
{
// Connection string
string connString = @"server=.\sql2012;database=AdventureWorks;
Integrated Security=SSPI";
// Query
string sql = @" select FirstName,LastName from Person.Contact
order by LastName";