I don't think you can run a sql query. Instead loop through the records and convert the logic in your sql statment into vb or whatever language that your using. That'l do donkey, that'l do
I found some extra info on why you can't fire a sql statement against a datatable, if you're interested.
Apparantly, since really datasets/datatables are really just XML in a pretty interface, there's no way to access them like you could old school recordsets that acted more like distributed, mini-databases.
This was from another user post, so although I'm not sure how bang on it is, it did make sense as I thought it through. Another option I thought of was to actually get the xml data, use an xslt transformation, and do it that way.
But that seemed too much like work too, so I have a code solution similar to Zar's idea of looping. Not what I would want as the ideal, but thats a limitation given more by microsoft.
one day, ONE DAY, users will stop buying 15 %^!@$@$ inch monitors and running 800x600 so I don't have to create these damn multi panel pages!
Upon a bit more thought, I think the best way to approach this would be to:
Extract the .defaultView from the table, which is really just a handle to the actual rows
Apply a .rowFilter to that view to get at the rows that you want to delete
Iterate through those rows, deleting them as you go
Remove the .rowFilter
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.