Home All Groups Group Topic Archive Search About

how does SqlCommandBuilder work?

Author
16 Nov 2007 7:29 PM
Andy Fish
hi,

I have seen by example that in order to use an SqlCommandBuilder, you just
have to instantiate it.

however, when trying to figure out what was happening, I looked in
reflector, and I can see that the SqlCommandBuilder constructor doesn't
actually do anything except store a reference to the DataAdapter. it does
not invoke the data adapter in any way.

how does this work? - I'm baffled !!!

Andy

Author
16 Nov 2007 10:30 PM
William Vaughn
The link "hooks" the Update method of the DataAdapter. When it's called the
CommandBuilder kicks in and does it's (black) magic the best it can.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

Show quote
"Andy Fish" <ajf***@blueyonder.co.uk> wrote in message
news:uL%23b5bIKIHA.5328@TK2MSFTNGP05.phx.gbl...
> hi,
>
> I have seen by example that in order to use an SqlCommandBuilder, you just
> have to instantiate it.
>
> however, when trying to figure out what was happening, I looked in
> reflector, and I can see that the SqlCommandBuilder constructor doesn't
> actually do anything except store a reference to the DataAdapter. it does
> not invoke the data adapter in any way.
>
> how does this work? - I'm baffled !!!
>
> Andy
>
>
Author
19 Nov 2007 10:48 AM
Andy Fish
I assumed it was doing something like that, but when I look in the code with
reflector, it doesn't access the DataAdapter at all in the constructon

Show quote
"William Vaughn" <billvaNoSPAM@betav.com> wrote in message
news:A1F96FE0-5B74-4626-A0E5-4134D2B98EA7@microsoft.com...
> The link "hooks" the Update method of the DataAdapter. When it's called
> the CommandBuilder kicks in and does it's (black) magic the best it can.
>
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant, Dad, Grandpa
> Microsoft MVP
> INETA Speaker
> www.betav.com
> www.betav.com/blog/billva
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> __________________________________
> Visit www.hitchhikerguides.net to get more information on my latest book:
> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
> -----------------------------------------------------------------------------------------------------------------------
>
> "Andy Fish" <ajf***@blueyonder.co.uk> wrote in message
> news:uL%23b5bIKIHA.5328@TK2MSFTNGP05.phx.gbl...
>> hi,
>>
>> I have seen by example that in order to use an SqlCommandBuilder, you
>> just have to instantiate it.
>>
>> however, when trying to figure out what was happening, I looked in
>> reflector, and I can see that the SqlCommandBuilder constructor doesn't
>> actually do anything except store a reference to the DataAdapter. it does
>> not invoke the data adapter in any way.
>>
>> how does this work? - I'm baffled !!!
>>
>> Andy
>>
>>
>

AddThis Social Bookmark Button