无法将数据表值写入CSV文件C# [英] unable to write datatable values to csv file c#

查看:116
本文介绍了无法将数据表值写入CSV文件C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

推荐答案

Vickyt,

Hi Vickyt,

感谢您的信息.我测试了您的代码,它对我而言非常有效.我可以在项目文件夹中看到这样的数据.我使用以下代码设置了str1和str2.请使用F5(调试)检查str1和str2的值.

Thank you for your post. I tested your code and it worked great on my side. I can see the data in project folder like this. I used following code to set str1 and str2. Please check the values of str1 and str2 using F5(Debug).

string str1 = "abc";
string str2 = "def";

Name,Property
"abc","def"

此外,请尝试使用绝对路径并再次测试吗?

In addition, please try using an absolute path and test again?

dt.WriteToCsvFile("D:\\Data.csv");    

最好的问候,
王丽

Best Regards,
Li Wang


这篇关于无法将数据表值写入CSV文件C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆