T
Tony
Here I have a simple example. If I use alternative 2 where a dataset is used
in this code the default table name is called Table which is correct.
But if I use alternative 1 where a DataTable is used instead then the
DataTable are not given any default name Why ?
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(connectionString);
string strSQL = "Select OrderID, Quantity, unitPrice from [Order
Details]";
SqlDataAdapter adapter = new SqlDataAdapter(strSQL, con);
DataSet ds = new DataSet();
DataTable dt = new DataTable();
1 // adapter.Fill(dt);
2 adapter.Fill(ds);
}
//Tony
in this code the default table name is called Table which is correct.
But if I use alternative 1 where a DataTable is used instead then the
DataTable are not given any default name Why ?
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(connectionString);
string strSQL = "Select OrderID, Quantity, unitPrice from [Order
Details]";
SqlDataAdapter adapter = new SqlDataAdapter(strSQL, con);
DataSet ds = new DataSet();
DataTable dt = new DataTable();
1 // adapter.Fill(dt);
2 adapter.Fill(ds);
}
//Tony