无法将数据表值写入CSV文件C#

无法将数据表值写入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