Here is a extension method which can be used to perform the Delete operation on a DataTable just like the select i.e. using a filterExpression: using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; public static class MyExtensions { /// <summary> /// Delete row based on filterExpression /// </summary> /// <param name="dt"></param> /// <param name="filterExpression"> just like select </param> /// <returns> number of ......
I ended up using the MS Excel objects to convert files from XLS to CSV . Converted CSV had comma "," as field separator. But, what if the a filed content has comma like "lastName,FirstName". Now if you use default .net split method to get the fileds of a row in csv file, it will treat "lastName,FirstName" as two fields. I ended up writing my own split method which will take care of the comma in fields: Private Function CustomSplit(ByVal sText As String,ByVal sSeparator As String) As String() Dim ......