【问题标题】:Error BC30456: 'ElementAtOrDefault' is not a member of 'System.Data.EnumerableRowCollection(Of System.Data.DataRow)'错误 BC30456:“ElementAtOrDefault”不是“System.Data.EnumerableRowCollection(Of System.Data.DataRow)”的成员
【发布时间】:2012-09-20 11:50:19
【问题描述】:

服务器上的编译器在以下行抛出错误“'ElementAtOrDefault' is not a member of 'System.Data.EnumerableRowCollection(Of System.Data.DataRow)'”:
Dim dr As DataRow = clientDataTable(0)
在我的 .ashx 文件中。当我之前尝试过时,它也抛出了这个错误
Dim strFirstName As String = clientDataTable(0)("FirstName").ToString()
我是否错误地声明了 DataRow,还是我还缺少其他东西?

【问题讨论】:

    标签: vb.net iis ashx


    【解决方案1】:

    尝试使用

    clientDataTable.Rows(0)
    

    而不是仅仅使用 (clientDataTable(0)) 这将确保您实际获取行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-21
      • 1970-01-01
      相关资源
      最近更新 更多