DataContext.Log Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the destination to write the SQL query or command.
public:
property System::IO::TextWriter ^ Log { System::IO::TextWriter ^ get(); void set(System::IO::TextWriter ^ value); };
public System.IO.TextWriter Log { get; set; }
member this.Log : System.IO.TextWriter with get, set
Public Property Log As TextWriter
Property Value
The writer to use for writing the command.
Examples
The following example displays generated SQL in the console window before it displays the results of the query.
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);
}
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
Remarks
Set this property to null
to disable command logging.
Applies to
التعاون معنا على GitHub
يمكن العثور على مصدر هذا المحتوى على GitHub حيث يمكنك أيضاً إضافة مشاكل وطلبات سحب ومراجعتها. للحصول على معلومات إضافية، اطلع على دليل المساهم لدينا.
الملاحظات
https://aka.ms/ContentUserFeedback.
قريبًا: خلال عام 2024، سنتخلص تدريجيًا من GitHub Issues بوصفها آلية إرسال ملاحظات للمحتوى ونستبدلها بنظام ملاحظات جديد. لمزيد من المعلومات، راجعإرسال الملاحظات وعرضها المتعلقة بـ