For those trying to implement this, you'll notice the GetNorthwindProductTable(). This could be anything that returns a DataTable, but here's a quick example for how to get pull records from the Northwind database.
Snippet 2: Fill a DataSet from a Microsoft SQL Server Database using SQLDataAdapter and DataSet classes
Contentsprivate DataTable GetNorthwindProductTable()
{
string connectionString = "workstation id=SERVERMASTER;packet size=4096;"
+ "integrated security=SSPI;data source=SERVERMASTER;"
+ "persist security info=False;initial catalog=Northwind";
string query = "select * from Products";
SqlDataAdapter da = new SqlDataAdapter(query, connectionString);
DataSet ds = new DataSet();
da.Fill(ds);
return ds.Tables["Table"];
} Back to Top