Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的问题,我是 mvc 新手,
我使用 List<> 从存储过程中获取数据,如下所示,
List<Sp_MM_GetDetails_Result> lDetails = objDB.Sp_MM_GetDetails(ArticleURL).ToList();
它对我来说工作正常,但我的 SP 返回2 个数据表。但是我的 List<> 只取第一个表的数据。
如果我想从第二个表中获取数据应该怎么做?
在 C# 中,我们可以使用
DataSet.Table[1]
您需要执行原始 SqlCommand 并执行 Translate 以映射到匹配的类型。
检查这个样本
https://msdn.microsoft.com/de-de/data/jj691402