惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
Attack and Defense Labs
Attack and Defense Labs
V2EX - 技术
V2EX - 技术
O
OpenAI News
S
Secure Thoughts
H
Heimdal Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
S
Security Affairs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
The Register - Security
The Register - Security
GbyAI
GbyAI
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Forbes - Security
Forbes - Security
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
The Cloudflare Blog
Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
Webroot Blog
Webroot Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
V
V2EX
T
Tailwind CSS Blog
SecWiki News
SecWiki News
NISL@THU
NISL@THU
C
Check Point Blog

博客园 - 北极冰点水

如何用C#代码设置文件的附加属性啊 例如author, subject 这些啊 在.NET中使TextBox只能输入数字的方法(key 和 clipboardData) - 北极冰点水 怎样在XML中使用&和字符 ViewState深入,Textbox,Checkbox,CheckboxList,RadioButtonList 不能禁止ViewState textbox web控件 根本无视enableviewsate 是否true 或者false, 依然能够相应用户的输入 什么是One-Click技术 未将对象引用到对象的实例 后期维护成本 用.net开发不同操作系统下应用的winform的size大小问题 怎样让用户可以跟踪查询数据库数据变化 在MembershipProvider中,现在的版本中MobileAlias 是没用的 也谈下vs2005中的gridview Vs2005 调试状态下的异常处理是比2003要好多了,布局图片也漂亮 vs2005 Gridview 得问题??? vs2005的数据库连接问题 2.0 Master Page C# 的 Delegate Type 安装SqlServer2005 Express Edit版 和 Vs 2005 CTP版 快速”格式化和常规格式化之间的区别
asp.net执行.sql文件 和 Cmd 模式执行sql文件 - 北极冰点水
北极冰点水 · 2006-04-17 · via 博客园 - 北极冰点水

asp.net执行.sql文件 和 Cmd 模式执行sql文件

asp.net执行.sql文件
今天想通过执行.sql脚本达到恢复统一客户端数据库版本数据的目的,找了段代码.好像有用
//应用Process前请引用:System.Diagnostics命名空间.
   string infile=System.Web.HttpContext.Current.Server.MapPath("test.sql");
   Process sqlprocess=new Process();
   sqlprocess.StartInfo.FileName="osql.exe";
   sqlprocess.StartInfo.Arguments=String.Format("-U {0} -P {1} -S {2} -i {3}","sa","123456","192.168.0.28",@infile); //U为用户名,P为密码,S为目标服务器的ip,infile为数据库脚本所在的路径
   sqlprocess.StartInfo.WindowStyle=ProcessWindowStyle.Hidden;
   sqlprocess.Start();
   sqlprocess.WaitForExit(); //等待程序执行.Sql脚本
   sqlprocess.Close();
   Response.Write("<script>alert('Ok.');</script>");
  
   命令行模式:
   osql /U sa /P sa /S 10.60.200.110 /i D:\MiantainProject\STP\ClientDBScript\ClientDB_DIC_Script.TAB

posted on 2006-04-17 11:53  北极冰点水  阅读(1828)  评论()    收藏  举报