Entity Framework中查看生成的SQL语句

 

 Entity Framework 4.0 中是这样的,高版本的跟这个有些差异,不太一样,貌似已经到7了

using (Entities entities = new Entities())
{
    var query = from st in entities.ShiTi
                select st;
    ObjectQuery oq = query as ObjectQuery;
    string sql = oq.ToTraceString();
    Console.WriteLine(sql);
}
posted @ 2014-09-05 13:56  任跃兵  阅读(333)  评论(0编辑  收藏  举报
总访问量: