| Devart.Data.Linq Namespace > DataContext Class : Log Property |
Prints the SQL query or command to the TextReader.
[Visual Basic]
Public Property Log As TextWriter [C#]
public TextWriter Log {get; set;}The following example displays generated SQL in the console window before it displays the results of the query.
[C#]
db.Log = Console.Out;
var custQuery =
from cust in db.Customers
where cust.City == "London"
select cust;
foreach (var custObj in custQuery)
{
Console.WriteLine(custObj.ContactName);
} [Visual Basic]
db.Log = Console.Out
Dim custQuery = _
From cust In db.Customers _
Where cust.City = "London" _
Select cust
For Each custObj In custQuery
Console.WriteLine(custObj.ContactName)
NextPlatforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows 7
DataContext Class | DataContext Members
© 2010 - 2013 Devart. All Rights Reserved.