Unable to cast object of type 'system.data.datatable' to type 'lInqobj.tbl1'
i am getting this error in
property.setAgent(((Agent)Session[FormContract.AGENT]).agent_id.ToString());
Unable to cast object of type 'system.data.datatable' to type 'lInqobj.Agent'
please help 开发者_Python百科me out
Clearly the object found at Session[FormContract.AGENT]
is not actually an Agent
, but a DataTable
, so it cannot be cast to an Agent
. Try figuring out what is putting that value there, and why it's putting a DataTable
there rather than an Agent
.
精彩评论