Tracing SQL generated by DataAdapter.Update(dataset)
-
Hello, How can I see the SQL generated by DataAdapter.Update(dataset) - if any. Here's a bit of context: I have a (typed) table adaptor (generated using Visual C# 2008) that fills a table from a query on a join (i.e. select all rows from a table that have a counterpart in another table). I managed to handle insertions (i.e. insert in the other table). Now for deletion...I set the DeleteCommand. I remove all the rows from the dataset and I call Update(). Nothing happens. Not even an exception. Either there's a problem with my DeleteCommand or it's never called. How can I find out ? Thanks, Jean-Louis
-
Hello, How can I see the SQL generated by DataAdapter.Update(dataset) - if any. Here's a bit of context: I have a (typed) table adaptor (generated using Visual C# 2008) that fills a table from a query on a join (i.e. select all rows from a table that have a counterpart in another table). I managed to handle insertions (i.e. insert in the other table). Now for deletion...I set the DeleteCommand. I remove all the rows from the dataset and I call Update(). Nothing happens. Not even an exception. Either there's a problem with my DeleteCommand or it's never called. How can I find out ? Thanks, Jean-Louis
-
I don't have SQL Profiler at the moment, I was wondering if it's possible to do it from within the program, e.g. if there is a logging facility built in datasets. J-L
-
I don't have SQL Profiler at the moment, I was wondering if it's possible to do it from within the program, e.g. if there is a logging facility built in datasets. J-L
-
Hello, How can I see the SQL generated by DataAdapter.Update(dataset) - if any. Here's a bit of context: I have a (typed) table adaptor (generated using Visual C# 2008) that fills a table from a query on a join (i.e. select all rows from a table that have a counterpart in another table). I managed to handle insertions (i.e. insert in the other table). Now for deletion...I set the DeleteCommand. I remove all the rows from the dataset and I call Update(). Nothing happens. Not even an exception. Either there's a problem with my DeleteCommand or it's never called. How can I find out ? Thanks, Jean-Louis
DataAdapters can only do very simple things -- e.g. working with only one table, with a primary key -- I don't think they have the smarts to Update joined data. Experienced developers don't use them.
-
DataAdapters can only do very simple things -- e.g. working with only one table, with a primary key -- I don't think they have the smarts to Update joined data. Experienced developers don't use them.
> DataAdapters [...] -- I don't think they have the smarts to Update joined data. That's why I provide an InsertCommand (which works fine) and a DeleteCommand (which isn't called :confused:). I won't need an UpdateCommand because I'm actually managing two listboxes to update an underlying link table. > Experienced developers don't use them. I'm not that experienced yet :laugh: I'm learning and trying to do things the proper .NET way, e.g. use DataSets instead of raw SQL. Also, typed datasets look like a good idea. What would you recommend ? J-L
-
> DataAdapters [...] -- I don't think they have the smarts to Update joined data. That's why I provide an InsertCommand (which works fine) and a DeleteCommand (which isn't called :confused:). I won't need an UpdateCommand because I'm actually managing two listboxes to update an underlying link table. > Experienced developers don't use them. I'm not that experienced yet :laugh: I'm learning and trying to do things the proper .NET way, e.g. use DataSets instead of raw SQL. Also, typed datasets look like a good idea. What would you recommend ? J-L