See Also

DataContext Class  | DataContext Members

Requirements

Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows 7

Language

Visual Basic

C#

Show All

See AlsoLanguagesDevart.Data.LinqSend comments on this topic.

Log Property

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;}

Remarks

The following example displays generated SQL in the console window before it displays the results of the query.

Example

[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)
Next

Requirements

Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows 7

See Also

DataContext Class  | DataContext Members

 

 


© 2010 - 2013 Devart. All Rights Reserved.