Is there a way to extract the SQL which is run against the database from a bit of subsonic? For instance I have
foreach (var item in EVT.All().Where(e => e.EVT_USRNAME == "stimms"))
{
...
}
Can I get at what is run?
Is there a way to extract the SQL which is run against the database from a bit of subsonic? For instance I have
foreach (var item in EVT.All().Where(e => e.EVT_USRNAME == "stimms"))
{
...
}
Can I get at what is run?
In Subsonic, you can get the command which will be executing against a query in this way:
IQueryable query = EVT.All().Where(e => e.EVT_USRNAME == "stimms");
SubSonic.Linq.Structure.DbQueryProvider provider = (SubSonic.Linq.Structure.DbQueryProvider)query.Provider;
string command = provider.GetCommand(query.Expression).CommandSql;
Simon, Another method that requires more under-hood revelation is to debug the Subsonic source-code. Set a breakpoint at your query, watch the evaluated statement, and look for the QueryText property.
MAbraham1