我想完全清除数据库并重置数据.最快的方法是什么?或者,什么是将删除表的所有行的命令(我将为所有表重复该过程)?
谢谢
我有一个实体模型,我一直在寻找一个linq查询,它返回每个祖父母的子女和父母的数量.
我需要输出3列:祖父母的姓名| 儿童数| 孙子的数量
protected void Page_Load(object sender, EventArgs e)
{
using (FamilyModel.TheConn myEntities = new FamilyModel.TheConn())
{
int TheUserID = 13; // will change later
var myOutput = from gparents in myEntities.GrandParents
where gparents.UserID == TheUserID
select gparent.Name, // here's what's missing: the counts
GridView1.DataSource = myOutput;
GridView1.DataBind();
}
}
Run Code Online (Sandbox Code Playgroud)
我一直在努力与SelectMany,Groupby,加入....我只是没有得到我需要这个看似简单的查询的结果.任何投入将不胜感激.
谢谢