如何从LINQ存储过程填充DataSet或DataTable?

时间:2014-01-27 16:12:06

标签: vb.net linq linq-to-sql

我正在尝试从sp填充数据表。但这似乎不对。关于我的方法的任何想法

Dim dt As New DataTable
     Using EdSQL As New MyEntities
       Dim Query = From St In EdSQL.MySp(Prameter).AsEnumerable
            Select St
            dt=Query.......
     End Using

1 个答案:

答案 0 :(得分:0)

我认为你需要这样的东西......

Dim EdSQL As New My Entities

Dim query = From st In EdSQL.MySp(Parameter).AsEnumerable
            Select St

gvStockEDI.DataSource = query.ToList()
gvStockEDI.DataBind()