Database Reference
In-Depth Information
try
{
// Open connection
conn.Open();
// Create Data Adapter
SqlDataAdapter da = new SqlDataAdapter(sql, conn);
// Create Dataset
DataSet ds = new DataSet();
// Fill Dataset
da.Fill(ds, "Production.Product");
// Display data
gvProduct.DataSource = ds.Tables["Production.Product"];
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + ex.StackTrace);
}
finally
{
//Connection close
conn.Close();
}
}
8. Build the project, and run the DataLooper form by pressing Ctrl+F5. Your
results should look like 15-4.
 
Search WWH ::




Custom Search