我现在是创建了一个控制台应用程序,然后:Process.Start(@"E:\a.sql");但是这样是打开a.sql 。并不是去执行a.sql 中的SQL语句。我想生成一个.exe ,我双击exe ,a.sql 中的SQL语句就可以自动执行。谢谢!PS:1. a.sql 中的SQL语句很多,所以我不想用读取内容再执行SQL语句的办法。2. 我需要代码。如果没有现成的代码,那么思路也好。只是我对控制台应用程序不熟悉。3. 非常感谢。
解决方案 »
- 时间比较
- 寻找用于 Windows Mobile 5.0 Pocket PC SDK 的插件
- 请问怎么用ZedGraph画饼图````高手告诉我一下 谢谢 我是新手 以前重来没有做过 这个图````希望写详细点 注释
- winform中datagridview邦定的问题
- 誰能介紹幾本C#2.0方面比較好的書
- APS.Net C# mouseover菜单的实现.请教!!
- 真诚求助,如何在水晶报表动态增加列.
- 请教关于使用DataReader和DataGrid配合使用显示数据的问题
- 我重写了个属性,可是不会调用,请高手指教
- 我想在一个文件前面加入几个字节,请问怎么实现?
- 关于数据抓取
- 今天怎么啦。到处都是错误
p.StartInfo.FileName="osql.exe";
p.StartInfo.Arguments=String.Format("-U {0} -P {1} -S {2} -i {3}","sa","sa","","");
p.StartInfo.WindowStyle=ProcessWindowStyle.Hidden;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden'
p.Start();
System.IO.StreamReader sr = p.StandardOutput;
Console.WriteLine(sr.ReadToEnd());
p.WaitForExit();
p.Close();
using System.IO;
class DirectoryLister
{
public static void Main(String[] args)
{
string path = ".";
if (args.Length > 0)
{
if (File.Exists(args[0])
{
path = args[0];
}
else
{
Console.WriteLine("{0} not found; using current directory:",
args[0]);
}
DirectoryInfo dir = new DirectoryInfo(path);
foreach (FileInfo f in dir.GetFiles("*.exe"))
{
String name = f. Name;
long size = f.Length;
DateTime creationTime = f.CreationTime;
Console.WriteLine("{0,-12:N0} {1,-20:g} {2}", size,
creationTime, name);
}
}
}
osql.exe 传参数