ASP.Net Error - Unable to cast object of type 'System.String' to type 'System.Data.DataTable'.
- by xtrabits
I get the below error
Unable to cast object of type 'System.String' to type 'System.Data.DataTable'.
This is the code I'm using
Dim str As String = String.Empty
If (Session("Brief") IsNot Nothing) Then
Dim dt As DataTable = Session("Brief")
If (dt.Rows.Count > 0) Then
For Each dr As DataRow In dt.Rows
If (str.Length > 0) Then str += ","
str += dr("talentID").ToString()
Next
End If
End If
Return str
Thanks