private static void CreatTables(string databaseName, string infile)
{
Process sqlprocess = new Process();
if (DataTypey == "MYSQL")
{
sqlprocess.StartInfo.FileName = "osql.exe";
// sqlprocess.StartInfo.Arguments = String.Format("-u {0} -h {1}
sqlprocess.StartInfo.Arguments = String.Format("-h localhost -u atian -p atian112? >E:\\web\\TrackingForm\\Web\\Scripts\\CreateScrapeStructsMySQL.sql");
}
else
{
sqlprocess.StartInfo.FileName = "osql.exe";
sqlprocess.StartInfo.Arguments = String.Format("-U {0} -P {1} -S {2} -i {3}", "sa", "zhongguowoaini1", "192.168.0.19", @infile);
}
sqlprocess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
sqlprocess.Start();
sqlprocess.WaitForExit(); //Wait for executing Sql File
sqlprocess.Close();
}
我的这个代码是想再mysql上执行文件中的脚本,但是现在问题是不能执行脚本文件,是我那块的代码写的不对吗?目前还没找到原因,求解~~~~~