Results 1 to 5 of 5

Thread: [2.0]

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    Unhappy [2.0]

    I have a data table with data in it.

    I want to insert data from this data table into a physical table in oracle. If both tables are in oracle then by using the sql I could insert like

    insert into temp2 (select * from temp1).

    temp1 and temp2 are oracle tables. but in my situation, temp1 is a datatable. How can I do this?

    thanks

    nath

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0]

    Create a DataAdapter. Create a Command with the appropriate SQL in its CommandText property. Add a parameter for each column being inserted. Assign the Command to the InsertCommand property of the DataAdapter. Call the Update method of the DataAdapter.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    Re: [2.0]

    Howdy Jm,

    can you point me to a link/sample that does this?

    thanks
    nath

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0]

    This is for SQL Server but the same principles apply to Oracle. Just change the types to the appropriate namespace. I'll leave it to you to convert it to C#.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    Re: [2.0]

    thanks Jm.

    I will use it.

    regards
    nath

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width