It is not clear what you want. The dataset is hierarchical: it contains a
collection of tables that contain a collection of rows that contain multiple
clumns. So it will not directly fit into an array, which does not have such
a structure. You could create an array of a sepecific datatype, such as
string, and fill it with the values of a certain column of all the rows of a
certain table:
DataSet ds = ...;
DataTable dt = ds.Tables[0];
const int desiredColumn = 1; //for instance
int length = dt.Rows.Count;
string[] theArray = new string[length];
for (int i=0; i<length; i++)
{
theArray = dt.Rows[desiredColumn];
}
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.