Unable to cast object of type 'System.String' to type 'System.Data.DataTable'.
Please help me how to resolved this error
my code
ctx.TempLedgerBranches.Add(postData);
Session["postData"] = postData;
DataTable mdt = (DataTable)Session["postData"]; error show on this line

Manish Kumar ChoudharyPosted Dec 12, 2014, 12:08 AM
it's simply means that Session["postData"] does not contains proper dataTable format. so you are getting this error. check Session["postData"] contains proper dataTable or not.
if Session["postData"] contains only string then u need to add that string inside DataTable rows
by using following code
DataTable dt = new DataTable("PostData");
DataColumn colPData = new DataColumn("colPData",typeof(System.String));
dt.Rows.Add(Session["postData"].Tostring());
Manish Kumar ChoudharyPosted Dec 12, 2014, 1:02 AM
check u previous question i reply there.
dipti prasadPosted Dec 12, 2014, 12:26 AM
You have knowledge in mvc??
Please help me how to store temparory data in jqgrid. how to add edit delete temp data in jqgrid??????? Please Please help me.....