Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't delete row
Message
 
 
To
10/04/2007 16:30:53
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01214017
Message ID:
01214178
Views:
13
>Tried that, didn't work.
>
>I'm using the CommandBuilder because I'm in learning this stuff and all the books said to use it. What do you suggest?
>
>>My first swag is to try using commandBuilder.RefreshSchema() after the fill.
>>The real question here is why are you using the commandBuilder?

As typical with most of .Net there are many ways. I know a lot of developers that shy away from the commandbuilder simply because they view it as a "blackbox". I used it back in version 1.0 but have not since the 1.1 framework was released. From what I remember it can be a bit testy.

Some developers just manually create the sql and execute using a command object. You will find a number of data classes that use this approach and are generally geared toward OR mapping. Others prefer using dataAdapters and even generating typed datasets. Most of this is using the 1.1 framework.

With 2.0 came the tableadapter that provides a wrapper around the dataAdapter layer. With VS 2005 you can use the TableAdapter configuration wizard. This allows you to use the query designer to create the sql select and it will generate the code to perform basic CRUD operations against the table. The table adapter can also contain multiple queries. In real world practice I find myself using both the tableadapter and command object to access data.

I'm digging though some of my older projects that used the commandbuilder but so far I have not seen an example using the delete command. I have found select and update. I noticed in my code that when I changed the select statement and did a fill I called the RefreshSchema method prior to issuing updates.
Michael McLain
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform