ASP.NET - DatatableTo Xml - Asked By Naresh Kumar on 23-Nov-10 07:45 AM

Hi

I have an excel sheet .
I am filling the datatable with the data in the excel.In Some rows in the excel i am not having any values.

So in the datatable i am getting empty cell for those fieds.

While i am trying to write xml for the datatabel.Nodes are not creating in xml for those having empty cell

Please Help
Venkat K replied to Naresh Kumar on 23-Nov-10 08:20 AM
You cant represent database null value in xml. Since it is database null, xml will not create node for that value. If you want to create a xml node for this blank value, you can use of database ISNULL() function in your sql query and replace the null value with blank string('').

    columnValue = ISNULL(column, '')


Thanks