I'm beginner in C#, I want use the bcp
utility in C# and to do so, I wrote this code:
string connstr = "Data Source=192.168.50.172;Initial Catalog=CDRDB;User ID=CDRLOGIN;Password=beh1368421";
//string connstr = "Enter your connection string here";
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = "bcp";
proc.StartInfo.Arguments = @"select * from CDRTABLE"" queryout c:\filename.csv -S 192.168.50.172 -U CDRLOGIN -P beh1368421 -f -w";
proc.Start();
That code runs, but filename.csv
is not created on my C:\
drive. What happened? How can I solve this problem?