views:

20

answers:

2

Do they even exist? We have a website with a massive DAL using strongly typed datasets. I think it would be great if I had a way to inject some tracing calls before and after each of the database calls. I don't see any events, nor any other way to hook into the TableAdapter such that I can get tracing calls before it executes the sql.

I know that I can create partial class files that could potentially give me access to what I'm looking for, but that would require creating hundreds of partial classes. I was really hoping to just hook into the codegen aspect that happens to the .xsd file instead.

Any suggestions?

A: 

The docs for xsd.exe, the tool that generates the XSD's are here:

http://msdn.microsoft.com/en-us/library/x6c1kb0s%28VS.80%29.aspx

Unfortunately I don't know of any templates, so I'm afraid you probably can't modify them.

MikeW
Yeah, it's not extensible.
Pavel Minaev
A: 

you can try making a Linq extension

This is an example to get non deleted rows from a data table

internal static EnumerableRowCollection<T> NotDeleted<T>(this TypedTableBase<T> rows)
        where T : DataRow
    {
        return rows.Cast<T>()
            .Where(a => a.RowState != DataRowState.Deleted);
    }
James