Category Archives: C#

Keep ‘\r\n’ in XML Serialization and Deserializtion in C#

The following example shows to keep the \r\n characters in the string after Serialization and Deserializtion. Generally when you serialize an object with a string value that contains ‘\r\n\’ (Carriage Return and new line characters in string) and after deserialize it than in the outcome ‘\r’ is disappeared. Suppose if you string is ‘5 Avenue … Continue reading Keep ‘\r\n’ in XML Serialization and Deserializtion in C#

Create new DataTable from the DefaultView of the another DataTable

The following article demonstrates how to create new DataTable from the DataView or DefaultView of another DataTable. The general requirement for doing this is that once you have retrieved DataTable from a data source and than you may need to sort or filter the data without retrieving it again. You can use the ToTable() method … Continue reading Create new DataTable from the DefaultView of the another DataTable