您好,命名空间: System.Data.Objects
程序集: System.Data.Entity(在 System.Data.Entity.dll 中)
语法
C#
C++
F#
VB
[BrowsableAttribute(false)]
public string ToTraceString()
返回值
类型:System.String
一个 string,表示查询对数据源执行的命令。
示例
本主题中的示例基于 Adventure Works Sales Model。
C#
VB
int productID = 900;
using (AdventureWorksEntities context =
new AdventureWorksEntities())
{
// Define the object query for the specific product.
ObjectQuery
context.Products.Where("it.ProductID = @productID");
productQuery.Parameters.Add(new ObjectParameter("productID", productID));
// Write the store commands for the query.
Console.WriteLine(productQuery.ToTraceString());
}