I would like to use a SQL query on a CSV file using C#. There is something like this for java here. Is there anything like this for c#?
You can use ODBC to run a query against a CSV File :
// using System.Data.Odbc;
string strConn = @"Driver={Microsoft Text Driver (*.txt; *.csv)};" +
"Dbq=C:;Extensions=csv,txt";
OdbcConnection objCSV = new OdbcConnection(strConn);
objCSV.Open();
OdbcCommand oCmd = new OdbcCommand("select column1,column2 " +
"from THECSVFILE.CSV", objCSV);
OdbcDataReader oDR = oCmd.ExecuteReader();
while (oDR.Read())
{
// Do something
}