ASP.Net Error - Unable to cast object of type 'System.String' to type 'System.Data.DataTable'.
Posted
by xtrabits
on Stack Overflow
See other posts from Stack Overflow
or by xtrabits
Published on 2009-10-04T08:47:19Z
Indexed on
2010/03/08
12:06 UTC
Read the original article
Hit count: 368
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
© Stack Overflow or respective owner