i am getting error "Unable to cast object of type System.data.datatable to type ReceiveproductDetailsDatatable" while trying to convert system.data.datatable to typed dataset.datatable.
I have created a strongly typed dataset with datatable ProductDetails. The declaration is as below.
ReceiveProducts.ReceiveProductDetailsDataTable ProductDataTbl = new ReceiveProducts.ReceiveProductDetailsDataTable(); I getting the product details from database and i want to put this in session for editing.
.ReceiveProductDetailsDataTable ProductDataTbl = new ReceiveProducts.ReceiveProductDetailsDataTable(); I getting the product details from database and i want to put this in session for editing.
I getting the product details from database and i want to put this in session for editing.
DataSet dsReceive = new DataSet();
DataSet dsReceive = new DataSet();dsReceive = objBZ.GetReceiveViewDetails(ReceiveListID);
DataTable dt = new DataTable();
DataTable dt = new DataTable();ProductDataTbl = (ReceiveProducts.ReceiveProductDetailsDataTable)dt;
ReceiveProducts.ReceiveProductDetailsDataTable)dt;The above statement gives error "Unable to cast object of type System.data.datatable to type ReceiveproductDetailsDatatable" while trying to convert system.data.datatable to typed dataset.datatable "
Session["Products"] = ProductDataTbl;
"Products"] = ProductDataTbl;
How should i do the casting to avoid this error?