=?ISO-8859-1?Q?Datasets=3A_Created_with_code_VS=2E_cre?==?ISO-8859-1?Q?ated_using_point=B4n_click?=

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?ISO-8859-1?Q?S=F8ren?=

    =?ISO-8859-1?Q?Datasets=3A_Created_with_code_VS=2E_cre?==?ISO-8859-1?Q?ated_using_point=B4n_click?=

    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("Custom erOrders")
    Dim ordersTable As DataTable = customerOrders. Tables.Add("Ord ers")
    Dim pkOrderID As DataColumn = ordersTable.Col umns.Add("Order ID",
    Type.GetType("S ystem.Int32"))
    ordersTable.Col umns.Add("Order Quantity", Type.GetType("S ystem.Int32"))
    ordersTable.Col umns.Add("Compa nyName",
    Type.GetType("S ystem.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
  • =?ISO-8859-1?Q?S=F8ren?=

    #2
    =?ISO-8859-1?Q?Re=3A_Datas ets=3A_Created_ with_code_VS=2E ?==?ISO-8859-1?Q?_created_us ing_point=B4n_c lick?=

    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:
    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("Custom erOrders")
    Dim ordersTable As DataTable = customerOrders. Tables.Add("Ord ers")
    Dim pkOrderID As DataColumn = ordersTable.Col umns.Add("Order ID",
    Type.GetType("S ystem.Int32"))
    ordersTable.Col umns.Add("Order Quantity", Type.GetType("S ystem.Int32"))
    ordersTable.Col umns.Add("Compa nyName",
    Type.GetType("S ystem.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

    Comment

    Working...