The update that gets generated with adapters always include all the
columns. That means that with each record update, all the columns get
updated as well. This presents a bit of a problem as I have some
triggers going on changes on specific fields. Is there way to instruct
adapter to regenerate the update statement based on changed columns
only?

TIA

lc

Re: Adapter with dynamic update statement by Miha

Miha
Sat Jun 19 03:33:43 CDT 2004

No, but you can create adapter manually.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"lc" <lcdata@hotmail.com> wrote in message
news:oup6d09kdd3n4f1k6u50p0kln11d6efqo9@4ax.com...
>
>
> The update that gets generated with adapters always include all the
> columns. That means that with each record update, all the columns get
> updated as well. This presents a bit of a problem as I have some
> triggers going on changes on specific fields. Is there way to instruct
> adapter to regenerate the update statement based on changed columns
> only?
>
> TIA
>
> lc



Re: Adapter with dynamic update statement by lc

lc
Sat Jun 19 11:20:36 CDT 2004

On Sat, 19 Jun 2004 10:33:43 +0200, "Miha Markic [MVP C#]" <miha at
rthand com> wrote:

>No, but you can create adapter manually.

Is there any reason why I shouldn't modify update statement in
Adapter.RowUpdating?

Thanks.

lc

Re: Adapter with dynamic update statement by Miha

Miha
Sat Jun 19 16:49:28 CDT 2004

I am not sure on this - I can see reasons why it won't work.
Try and see what happens.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"lc" <lcdata@hotmail.com> wrote in message
news:frp8d0deu49v1ge9miskgav820ft1bcgj9@4ax.com...
> On Sat, 19 Jun 2004 10:33:43 +0200, "Miha Markic [MVP C#]" <miha at
> rthand com> wrote:
>
> >No, but you can create adapter manually.
>
> Is there any reason why I shouldn't modify update statement in
> Adapter.RowUpdating?
>
> Thanks.
>
> lc



Adapter with dynamic update statement by Rich

Rich
Sun Jun 20 00:53:40 CDT 2004

Well, just a shot in the dark, but how about if you
declare your sql DataAdapter like this:
...
Dim sqlDA As SqlDataAdapter = new SqlDataAdapter
sqlDA.SelectCommand = New SqlCommand("Select fld1, fld2,
fld3 From tbl1", conn)
Dim cmdBd As CommandBuilder = new CommandBuilder(sqlDA)

Say tbl1 contains 10 fields, your dataAdapter is only
connecting to 3 fields. I don't know if selecting fields
that are not triggered and then running an insert command
won't set off the triggers. But you could try this.

Rich

>-----Original Message-----
>
>
>The update that gets generated with adapters always
include all the
>columns. That means that with each record update, all the
columns get
>updated as well. This presents a bit of a problem as I
have some
>triggers going on changes on specific fields. Is there
way to instruct
>adapter to regenerate the update statement based on
changed columns
>only?
>
>TIA
>
>lc
>.
>

Re: Adapter with dynamic update statement by lc

lc
Mon Jun 21 09:56:11 CDT 2004


Good shot. Thanks.

In the meantime, it "occurred" to me that the command has to change
with each record to be updated. Adapter.RowUpdating and RowUpdated
come to mind.

lc