Code
using (var ObjectContext = new AgentSystemEntities())
{
string entitySQL = "SELECT VALUE Top(10) u FROM Users AS u;";
ObjectQuery<Users> query = ObjectContext.CreateQuery<Users>(entitySQL);
string message = "执行的语句:" + query.CommandText + "\n\r";
if (query.Count() > 0)
{
message += query.First().UserNames + "\n\r";
}
else
{
message += "没有数据\n\r";
}
MessageBox.Show(message);
}
顺我者昌,逆我者亡.
posted on
2009-10-09 14:29
流氓宝宝
阅读(
508)
评论()
编辑
收藏
举报