Never get SqlCommandBuilder to work

  • Thread starter Thread starter Jimmy
  • Start date Start date
J

Jimmy

Dear all,

Any one of you have successfully use the SqlCommandBuilder? I am
pissed off by it, I have tried out several tutorials but stil have got
it working yet :(

Any working examples would be much help to me.
Thank you very very much.
Cheers,
 
Jimmy said:
Dear all,

Any one of you have successfully use the SqlCommandBuilder? I am
pissed off by it, I have tried out several tutorials but stil have got
it working yet :(

Any working examples would be much help to me.
Thank you very very much.

Hi Jimmy,

I know this isn't what you asked, but there is a school of thought that says
"don't use CommandBuilders". Here's an article with good justification and
an explanation of a way to work around it:

Weaning Developers from the CommandBuilder by William Vaughn

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadonet/html/CommandBuilder.asp

Joe
 
Just follow these steps:
1. Create a new adapter
2. Create a new SqlCommandBuilder passing ur adapter in the constructor.
The builder will now listen for updating events of the adapter.
3. Proceed updating the db using the adapter, as the builder would have
created the necessary commands.

Note that the select command used should return at least a primary or
unique column for the builder to work.

Check out this MSDN help link:
ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemDataSqlClientSqlComman
dBuilderClassTopic.htm

HTH,
fbhcah
 
Back
Top