Is there any form of statement which converts a datarow to a CSV line so it could be written to a .csv file? (with or without steps in between)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A quick Google search turned this up:
http://www.rcs-solutions.com/blog/2009/01/15/ConvertDataTableToCSVViaExtensionMethod.aspx
It’s a bit dated. There is no native way to do it, so you’ll need to either iterate over the datatable using looping constructs, but I’d recommend using LINQ methods as it will be much cleaner.