copying a datatable content from an untyped dataset into a table which is inside a typed dataset

Discussion in 'ASP .Net' started by Nedu N, Oct 30, 2003.

  1. Nedu N

    Nedu N Guest

    Hi Techies,

    I am facing problem in copying content of table from a untyped dataset into
    to a table inside the typed dataset. I wanted to copy the data into typed
    dataset in order to ease the further processing using typed references.

    DataSet ds = getDataFromDB(); - i am getting the dataset ds from a
    webservice

    I have got MyXSD which decsribes the shcema for the table which i am getting
    from the webservice
    and i am trying to cast like following
    MyXSD myds = (MyXSD)ds; ==> but giving me invalid exception error

    And i tried copying the table from ds into myds like
    myds.Tables[0] = ds.Tables[0];

    but it is giving me error saying myds.Tables[0] is READ ONLY....

    I tried ImportRow also but getting errors and i don't want to manually go
    thru the rows and put into my Typed dataset..

    Thanks for your help.

    Nedu
     
    Nedu N, Oct 30, 2003
    #1
    1. Advertising

  2. Nedu N

    Nedu N Guest

    Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset

    Hi All,
    I am facing problem in copying content of table from a untyped dataset into
    to a table inside the typed dataset. I wanted to copy the data into typed
    dataset in order to ease the further processing using typed references.

    DataSet ds = getDataFromDB(); - i am getting the dataset ds from a
    webservice

    I have got MyXSD which decsribes the shcema for the table which i am getting
    from the webservice
    and i am trying to cast like following
    MyXSD myds = (MyXSD)ds; ==> but giving me invalid exception error

    And i tried copying the table from ds into myds like
    myds.Tables[0] = ds.Tables[0];

    but it is giving me error saying myds.Tables[0] is READ ONLY....

    I tried ImportRow also but getting errors and i don't want to manually go
    thru the rows and put into my Typed dataset..

    Thanks for your help.

    Nedu
     
    Nedu N, Oct 30, 2003
    #2
    1. Advertising

  3. Nedu N

    Cor Guest

    Re: Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset

    Hi Nedu,

    > myds.Tables[0] = ds.Tables[0];


    I dont believe this can work.
    It seems if you want to add a table without his scheme on a already (or not)
    existing place.

    But maybe you just mean?
    myds=ds.copy;

    Cor
     
    Cor, Oct 31, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nedu N
    Replies:
    1
    Views:
    1,837
    Chris Taylor
    Oct 31, 2003
  2. Ersin Gençtürk
    Replies:
    1
    Views:
    3,548
    Ersin Gençtürk
    Oct 6, 2004
  3. thomson
    Replies:
    2
    Views:
    14,873
    Eliyahu Goldin
    Jan 19, 2005
  4. Nedu N
    Replies:
    2
    Views:
    241
    Jacob Yang [MSFT]
    Oct 31, 2003
  5. Paul Aspinall

    Typed vs Untyped datasets.....

    Paul Aspinall, Jul 13, 2003, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    307
    sampsons
    Jul 14, 2003
Loading...

Share This Page