in my program i have one data table that name is
DataTable dtCustInfo = custInfoMaster.SelectCustomerByMobileForCAF();
when i want write xml file form this tabel i got the error for what reasion it came
code:dtCustInfo.writeXml("d:\\mytext.xml");
what is the solution for this error the error is
Cannot serialize the DataTable. DataTable name is not set.
Loading
Othmane BouesgaPosted May 5, 2015, 3:27 AM
Amit ChoudharyPosted Jul 6, 2010, 6:14 AM
try below code
DataTable dtCustInfo = custInfoMaster.SelectCustomerByMobileForCAF();
if(dtCustInfo!=null)
{
dtCustInfo.TableName="CustomerInformation";
dtCustInfo.writeXml("d:\\mytext.xml");
}
Please mark as answer if it helps.
Praveen KumarPosted Jul 6, 2010, 6:11 AM
dtCustInfo.TableName = "Custtable";