广州亚德客,16kbook,龙门县地图
如下代码:
被的调用方法:
public static string execommand(string commandtext)
{
process p = new process();
p.startinfo.filename = "cmd.exe";
p.startinfo.useshellexecute = false;
p.startinfo.redirectstandardinput = true;
p.startinfo.redirectstandardoutput = true;
p.startinfo.redirectstandarderror = true;
p.startinfo.createnowindow = true;
string stroutput = null;
try
{
p.start();
p.standardinput.writeline(commandtext);
p.standardinput.writeline("exit");
stroutput = p.standardoutput.readtoend();
p.waitforexit();
p.close();
}
catch (exception e)
{
stroutput = e.message;
}
return stroutput;
}
调用方法:
protected void button1_click(object sender, eventargs e)
{
string sqlquery = "sqlcmd.exe -u sa -p 123 -s 20100330-0922 -d test -i c:\\1.sql";
string strrst = execommand(sqlquery);
}
1.sql文件
use master
go
create endpoint orders_endpoint6
state=started
as http(
path='/sql/orders6',
authentication=(integrated),
ports=(clear)
)
for soap(
webmethod 'custordersorders'(
name='test.dbo.getalltb12'
),
wsdl=default,
database='test',
namespace='http://mysite.org/'
)
bs程序如果执行的话,客户端不安装sqlcmd不知能否运行?
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
-
sql某个日期是当年的第几周
/* *周一作为一周的开始 *当年的1月1号所在的周算作第一周 */ CREATE function GetWeekIndexFirstDate ( @...
[阅读全文]
-
-
数据库SQL---范式
1、数据冗余导致的问题:冗余存储、更新异常、插入异常、删除异常。 2、函数依赖:一种完整性约束。 在关系模式r(R)中,α属于R,β属于R。 1)α函数...
[阅读全文]
-
-
数据库SQL---查询
1、查询所有列 select *from emp;--*表示所有的,from emp表示从emp表中查询。 2、查询指定列 select empno,e...
[阅读全文]
-
-
-
-
网友评论