system
1
// set up the connection
SqlConnection myConn = new SqlConnection (
"server=(local)\\NetSDK; trusted_connection=yes; database=northwind" );
// set up the query
SqlDataAdapter myCmd = new SqlDataAdapter (
"select * from customers", myConn );
// initialize dataset object
DataSet myData = new DataSet ( );
// fill with query results
myCmd.Fill ( myData, "Customers" );
// display dataset contents
foreach ( DataTable table in myData.Tables ) {
foreach ( DataRow row in table.Rows ) {
foreach ( DataColumn col in table.Columns ) {
Response.Write ( row [ col ].ToString ( ) );
}
}
}