Sql and c#

Discussion in 'Microsoft C# .NET' started by DaveP, Oct 1, 2007.

  1. DaveP

    DaveP Guest

    hi all.
    i have a Situation where i have a offline table using
    dataset and (sqlAdapter)
    this table has many rows...i need to line a id column
    to another ID2 Column Back at the database

    i dont want to select 1 by 1 select from the database

    looking for examples of getting the data from the server to complete my
    record set (table) and do a batch updata

    this table data is from a external text file that was parsed into the
    offline table

    TiA
    DaveP
     
    DaveP, Oct 1, 2007
    #1
    1. Advertisements

  2. DaveP

    Guest Guest

    hi,
    it depends on the version of the ADO you are using, to my knowlage, its
    simply doable in ADO 2.0, check the following link

    http://davidhayden.com/blog/dave/archive/2006/01/05/2665.aspx


    Regards,
    Husam Al-A'araj
    www.aaraj.net

    "DaveP" wrote:

    > hi all.
    > i have a Situation where i have a offline table using
    > dataset and (sqlAdapter)
    > this table has many rows...i need to line a id column
    > to another ID2 Column Back at the database
    >
    > i dont want to select 1 by 1 select from the database
    >
    > looking for examples of getting the data from the server to complete my
    > record set (table) and do a batch updata
    >
    > this table data is from a external text file that was parsed into the
    > offline table
    >
    > TiA
    > DaveP
    >
    >
    >
    >
    >
     
    Guest, Oct 1, 2007
    #2
    1. Advertisements

  3. DaveP

    Arnshea Guest

    On Oct 1, 4:31 pm, "DaveP" <> wrote:
    > hi all.
    > i have a Situation where i have a offline table using
    > dataset and (sqlAdapter)
    > this table has many rows...i need to line a id column
    > to another ID2 Column Back at the database
    >
    > i dont want to select 1 by 1 select from the database
    >
    > looking for examples of getting the data from the server to complete my
    > record set (table) and do a batch updata
    >
    > this table data is from a external text file that was parsed into the
    > offline table
    >
    > TiA
    > DaveP


    What database are you using? If I understand your problem correctly
    then about the best you can do is use some kind of ArrayBinding to
    bind all of the offline IDs to an update statement. Not all .NET
    providers support array binding.

    Other alternatives:
    -Combine several update statements into a batch and repeatedly
    transmit the batch. You can programmatically handle binding values
    (e.g., Parameters["NewField"+i].Value = ....) to avoid inlining
    parameter values. Experiment to find the largest batch size your
    database will support.

    -Create a stored procedure that updates values for several rows at
    once, call the stored procedure repeatedly until you've updated all
    values.

    I'm pretty sure the ODP.net drives for Oracle have support for
    ArrayBinding. I haven't seen any comparable ability for SqlServer2000
    but this may have been added in 2005...
     
    Arnshea, Oct 1, 2007
    #3
    1. Advertisements

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. VegaGucci

    C# and/or SQL gurus needed ! sql bit field & c#

    VegaGucci, Feb 13, 2004, in forum: Microsoft C# .NET
    Replies:
    1
    Views:
    275
    VegaGucci
    Feb 13, 2004
  2. stanger
    Replies:
    1
    Views:
    205
    Michael C
    Oct 27, 2004
  3. Paul Aspinall
    Replies:
    5
    Views:
    423
    Paul Aspinall
    Jan 14, 2005
  4. Paul Aspinall

    Sync SQL Server Express 2005 and SQL Server Mobile 2005.

    Paul Aspinall, Dec 4, 2005, in forum: Microsoft C# .NET
    Replies:
    2
    Views:
    235
    Cowboy \(Gregory A. Beamer\)
    Dec 5, 2005
  5. DR
    Replies:
    1
    Views:
    444
    Willy Denoyette [MVP]
    Nov 3, 2007
Loading...

Share This Page