asp.net - Problem with asmx webmethod that uses Mysql Load Data local infile -
when use following in webmethod:
string mysqlspath = server.mappath("applog.txt"); command.commandtext = "load data local infile '" + mysqlspath + "' table numbers fields terminated ',' lines terminated '\n'"; command.executenonquery(); connection.close();
i error load data local infile ---> not find file 'c:\windows\system32\inetsrv\inetpubwwwrootwebservicesapplog.txt'
when looking @ error noticed after "inet" dropping "\" between rest of directories, causing , how can fix it?
you'll need escape mysqlspath variale first.
something trick
mysqlspath = mysqlspath.replace(@"\", @"\\");
this convert \ \ c# won't remove it.
Comments
Post a Comment