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 Openrowsets .
Enable SQL Ad Hoc/Openrowset in SQL configuration first. Once enabled you'll be able to connect your SQL Server Managerment studio and query Excel and comma delimited files.
Your queries will look something like:
SELECT * FROM OPENROWSET('MSDASQL','Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir={your path}','SELECT * FROM ypurtextfile.csv')
You can use these queries in your C# code just like you query any other tables. Just check with your manager that he's ok with you enabling ad hoc on the SQL Server