RowUpdating missing in DbDataAdapter

  • Thread starter Thread starter Glen
  • Start date Start date
G

Glen

I'm trying to convert from using System.Data.SqlClient to using
System.Data.Common.

Everything is looking good, except that the events RowUpdating and
RowUpdated do not exist in the DbDataAdapter.

So,
SqlDataAdapter.RowUpdating
and
OracleDataAdapter.RowUpdating
do not have a matching event in DbDataAdapter.

How do I do these events if using DbDataAdapter?

Do I need to revert to directly coding against Oracle and Sql ? If so, that
would be the only point in the code that is not relying on the Common
library.

Glen
 
Hi Glen,

Thank you very much for your feedback. Based on my research, this is a
known issue in current .NET framework.

There is no good solution to the problem. Here are some workaround:
1. Cast the object to SqlDataAdapter and re-use as you point it in your post
2. Use reflection to call RowUpdating(/RowUpdated) event

You can check the following links for more information on this issue.

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?Feedbac
kID=93909

http://forums.microsoft.com/msdn/showpost.aspx?postid=109151&siteid=1

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Unfortunately, there comes a point where you can only go so far with
writing provider-independent code in ADO.NET 2.0 and you need to
branch into provider-specific code to get full functionality. Another
roadblock is passing parameters. The topic "Working with a
DbDataAdapter" under the "Working with Factories node"
(http://msdn2.microsoft.com/en-us/library/fks3666w.aspx) explains the
parameter issue in more detail.

--Mary
 
Back
Top