【发布时间】:2015-06-08 17:26:17
【问题描述】:
问题已更新:
我正在使用 C# + SQL Server + EF6 我需要对没有实体的数据库执行原始 SQL 命令。
string query2 = "SELECT s.Name, t.State, Count(*) [Nb],
AVG(t.Duration) [Avg],
MIN(t.Duration) [Min],
MAX(t.Duration) [Max] from ...";
如何在EF6中得到查询结果?
【问题讨论】:
-
我已经编辑了你的标题。请参阅“Should questions include “tags” in their titles?”,其中的共识是“不,他们不应该”。
-
为什么
(("SELECT中有双左括号 -
使用
SqlQuery,而不是ExecuteSqlCommand。 -
codeproject.com/Articles/4416/… google 搜索“c# result from sql server”的第一个结果
标签: c# sql-server entity-framework