Deleting a row

Discussion in 'Microsoft ADO .NET' started by Ronny, Oct 12, 2008.

  1. Ronny

    Ronny Guest

    When deleting a row I set the SelectCommand property in order to create the
    dataset and the DeleteCommand property.
    Do I have to set the InsertCommans and the UpdaeCommand also?

    Regards
    Ronny
     
    Ronny, Oct 12, 2008
    #1
    1. Advertisements

  2. Ronny

    daveL Guest

    all commands of sqldataadapter only need to be set if
    there gonna be used

    DaveL

    "Ronny" <> wrote in message
    news:eJH%23%...
    > When deleting a row I set the SelectCommand property in order to create
    > the dataset and the DeleteCommand property.
    > Do I have to set the InsertCommans and the UpdaeCommand also?
    >
    > Regards
    > Ronny
    >
     
    daveL, Oct 12, 2008
    #2
    1. Advertisements

  3. Ronny

    Ronny Guest

    Thanks,
    But this is exactly my question...
    When using Update, in order to push data back to the database the ADO.NET
    uses the prepared command automatically and I don't know if it needs also
    those that I mentioned.
    Regards
    Ronny
    "daveL" <> wrote in message
    news:mJnIk.4699$...
    > all commands of sqldataadapter only need to be set if
    > there gonna be used
    >
    > DaveL
    >
    > "Ronny" <> wrote in message
    > news:eJH%23%...
    >> When deleting a row I set the SelectCommand property in order to create
    >> the dataset and the DeleteCommand property.
    >> Do I have to set the InsertCommans and the UpdaeCommand also?
    >>
    >> Regards
    >> Ronny
    >>

    >
    >
     
    Ronny, Oct 14, 2008
    #3
  4. Ronny

    daveL Guest

    if you have a identity key from your select
    then the update will only up rows that were changed

    I always build my own update command using the table.schema....
    SqlcommandBuilder works wonders
    for most if not all normal updates

    work with it with test data till u get a handle with adapter.update()

    try sqlcommandbuilder print the commands it creates out
    so you can see what it is acually doing

    DaveL

    "Ronny" <> wrote in message
    news:...
    > Thanks,
    > But this is exactly my question...
    > When using Update, in order to push data back to the database the ADO.NET
    > uses the prepared command automatically and I don't know if it needs also
    > those that I mentioned.
    > Regards
    > Ronny
    > "daveL" <> wrote in message
    > news:mJnIk.4699$...
    >> all commands of sqldataadapter only need to be set if
    >> there gonna be used
    >>
    >> DaveL
    >>
    >> "Ronny" <> wrote in message
    >> news:eJH%23%...
    >>> When deleting a row I set the SelectCommand property in order to create
    >>> the dataset and the DeleteCommand property.
    >>> Do I have to set the InsertCommans and the UpdaeCommand also?
    >>>
    >>> Regards
    >>> Ronny
    >>>

    >>
    >>

    >
    >
     
    daveL, Oct 16, 2008
    #4
  5. Yes,

    But as Dave wrote, in most simple situations (by instance less than 100
    columns, no broken columnnames and no relations) you can use the
    commandbuilder much easier.

    Cor

    "Ronny" <> schreef in bericht
    news:...
    > Thanks,
    > But this is exactly my question...
    > When using Update, in order to push data back to the database the ADO.NET
    > uses the prepared command automatically and I don't know if it needs also
    > those that I mentioned.
    > Regards
    > Ronny
    > "daveL" <> wrote in message
    > news:mJnIk.4699$...
    >> all commands of sqldataadapter only need to be set if
    >> there gonna be used
    >>
    >> DaveL
    >>
    >> "Ronny" <> wrote in message
    >> news:eJH%23%...
    >>> When deleting a row I set the SelectCommand property in order to create
    >>> the dataset and the DeleteCommand property.
    >>> Do I have to set the InsertCommans and the UpdaeCommand also?
    >>>
    >>> Regards
    >>> Ronny
    >>>

    >>
    >>

    >
    >
     
    Cor Ligthert[MVP], Oct 17, 2008
    #5
    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. Jorge
    Replies:
    7
    Views:
    460
    Ian Phillips
    Aug 4, 2003
  2. Tolga Erdogus

    Quickly deleting the detail records of a master row

    Tolga Erdogus, Oct 7, 2003, in forum: Microsoft ADO .NET
    Replies:
    4
    Views:
    222
    Tolga Erdogus
    Oct 7, 2003
  3. Benedikt Eckhard

    Stop deleting a Row in the Changing event within a DataGrid

    Benedikt Eckhard, Nov 19, 2003, in forum: Microsoft ADO .NET
    Replies:
    2
    Views:
    308
    Benedikt Eckhard
    Nov 21, 2003
  4. babylon
    Replies:
    3
    Views:
    263
    William Ryan
    Jan 14, 2004
  5. Deleting Child Row Deletes Parent Row?

    , Dec 15, 2004, in forum: Microsoft ADO .NET
    Replies:
    0
    Views:
    430
Loading...

Share This Page