Reputation: 13659
I have created this DataSet and add a DataTable on it.
My problem is I don't know how to access this DataTable (Addresses) in my program.
Please advise. Thanks.
Upvotes: 2
Views: 201
Reputation: 1063864
DataSet1 is the type; you need an instance that you load with data via an adapter. That should then be easily available:
DataSet1 ds = new DataSet1();
// todo: use an adapter to load the desired data
var addresses = ds.Addresses;
Or
var addresses = ds["Addresses"];
That said; dataset/DataTable is definitely not how I would do data access. You might want to look instead at tools like LINQ-to-SQL or Entity Framework.
Upvotes: 8