当没有任何可用行时,下面的代码行 CopyToDataTable() 会引发错误,如何处理?
<WebMethod()> _
Public Shared Function GetContestants() As String
Dim dttemp As DataTable
currentCount += pageSize
dttemp = dtContestantList.Rows.Cast(Of System.Data.DataRow)().Skip(currentCount).Take(pageSize).CopyToDataTable()
Return GetJson(dttemp)
End Function