Page 1 of 1

issues when using log()

Posted: Wed 26 Jan 2011 16:12
by yusufbs
hi

I am using devart linqConnect Model

I want to see the sql that my linq statement generates

So I am using this code

StreamWriter httpResponseStreamWriter = new StreamWriter(Response.OutputStream);
dc.log = httpResponseStreamWriter ;


Generates the sql, but entire sql is not displayed (this table has more that 200 columns)
var req = from re in cb.Requests
where re.Requestid == "{d6022fb5-2883-4e37-ac37-b7964c12ea1c}"
select re;


does not generate the sql
var req = from re in cb.Requests
where re.Requestid == "{d6022fb5-2883-4e37-ac37-b7964c12ea1c}"
select re.Requestid;


does not generate the sql
var req = from re in cb.Requests
join eq in cb.Equifaxes
on re.Requestid equals eq.Requestid
where re.Requestid == "{d6022fb5-2883-4e37-ac37-b7964c12ea1c}"
select re.Requestid;
select new zzz
{
name = re.FirstName,
score = eq.FicoScore
};


There are no errors in any of the linqs

Also when using devart entity model, i dont even have the log method to see the sql

Can somebody please let me know why this is happening and how do I get past it

Thanks

Yusufbs

Posted: Thu 27 Jan 2011 16:14
by AndreyR
Please check the Response.BufferOutput property, this can be the reason of displaying only a part of the log. As an alternative, check the log using simple StringWriter, and check if it is populated correctly.
As for Devart Entity models, Entity Framework does not provide embedded Context-level tracing tools. You can either use the ToTraceString method, or use DBMonitor.
Here is an article about DBMonitor application usage. In case you prefer to have a component in your application, not a standalone tracing application, check out this article.