Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 更新从EntityDataSource筛选的ObjectDataSource会更新EntityDataSource吗?_C#_Asp.net_.net_Entity Framework - Fatal编程技术网

C# 更新从EntityDataSource筛选的ObjectDataSource会更新EntityDataSource吗?

C# 更新从EntityDataSource筛选的ObjectDataSource会更新EntityDataSource吗?,c#,asp.net,.net,entity-framework,C#,Asp.net,.net,Entity Framework,在ASP.NET Web窗体中,如果以编程方式将所选项目绑定到FormView,则使用主控/详细信息设置,其中Gridview用于选择,FormView用于详细信息,如下所示: protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { var context = new DataAccessLayer.SafetyEntities(); var se = (fro

在ASP.NET Web窗体中,如果以编程方式将所选项目绑定到FormView,则使用主控/详细信息设置,其中Gridview用于选择,FormView用于详细信息,如下所示:

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        var context = new DataAccessLayer.SafetyEntities();
        var se = (from c in context.Employees
                  where c.EID == (long)GridView1.SelectedDataKey.Value
                  select c).ToList();
        FormView1.DataSource = se;
        FormView1.DataBind();
    }
我更新了FormView中的数据,这些变化会反映在原始上下文中吗

此外,如何以编程方式更新FormView中使用的条目

我读过以下帖子:,但他填充formview的方式与我不同

我应该这样填充FormView吗