String CmdString = "select * from YourTable";
SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(SelectCmdString, myConnection);
SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(CmdString);
DataSet myDataSet = new DataSet();
mySqlDataAdapter.Fill(myDataSet,"YourTable");
Here the entire table
“YourTable”
with the same structure will be copied to the
DataTable
.
myDataSet.Tables[0];
[kschuler addition]
If you want the structure without also pulling the data, one trick you could use would be to add a where 1=2 clause to the select statement above. So instead of using
"select * from YourTable"
which was suggested up above, you would use
"select * from YourTable where 1=2"