Link to home
Start Free TrialLog in
Avatar of bemara57
bemara57

asked on

How do I add DataTables to a DataSet in ASP.NET 2.0 / C#?

I would like to use a DataSet instead of a bunch of scattered DataTables. How do I add DataTables to a DataSet and reference those tables from the DataSet? Here is an example that I'm trying to do:

        DataSet dbTable = new DataSet("Structure");

        DataTable fileTable = new DataTable("Files");
        fileTable.Columns.Add("Name", typeof(String));
        fileTable.Columns.Add("Size", typeof(Double));
        fileTable.Columns.Add("Directory", typeof(Double));

        DataTable directoryTable = new DataTable("Directories");
        directoryTable.Columns.Add("Name", typeof(string));
        directoryTable.Columns.Add("Parent", typeof(string));
        directoryTable.Columns.Add("CreationTime", typeof(DateTime));
ASKER CERTIFIED SOLUTION
Avatar of Elvio Lujan
Elvio Lujan
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial