Datasets: Created with code VS. created using point´n click


S

Søren

Hi guys

This is just driving me mad. :-| Here´s the thing:

When a dataset has been created like this:


Dim customerOrders As DataSet = New DataSet("CustomerOrders")
Dim ordersTable As DataTable = customerOrders.Tables.Add("Orders")
Dim pkOrderID As DataColumn = ordersTable.Columns.Add("OrderID",
Type.GetType("System.Int32"))
ordersTable.Columns.Add("OrderQuantity", Type.GetType("System.Int32"))
ordersTable.Columns.Add("CompanyName",
Type.GetType("System.String"))


... then this is possible:


Dim test = customerOrders.Tables("Orders").AsEnumerable()


... but when a dataset has been created by adding a new item to the
project resulting in a .xsd file, then it seems to be a completely
different type of dataset, which doesn´t have all the methods that the
dataset created though code does [ie. Tables()].

Is this basicly just two different kind of datasets (a good one and a
completely useless one)?

Regards Søren
 
Ad

Advertisements

S

Søren

I finally figured it out. I wasn´t the dataset at all .. it was problems
with variable scope, that broke the connection to the dataset. :)

Regards Søren


Søren skrev:
 

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.

Ask a Question

Top