C# SQLServer retrieving results and place in a .csv format

前端 未结 5 657
孤街浪徒
孤街浪徒 2020-12-09 20:53

I had a look on the site and on Google, but I couldn\'t seem to find a good solution to what I\'m trying to do.

Basically, I have a client server application (C#) wh

5条回答
  •  孤街浪徒
    2020-12-09 21:11

    You may be able to adapt the implementation of a CSV writer available here.

    If you also need to parse CSV files, the implementation here is relatively good.

    The CSV format is more complicated than it looks - particularly if you're going to deal with arbitrary data coming back from a query. You would need to be able to handle escaping of special characters (like quotes and commas), dealing with line breaks, and the like. You are better off finding and using a proven implementation - especially if you're new to C#.

提交回复
热议问题