您的位置:程序门 -> .net技术 -> c#



麻烦大家帮忙看看为什么会出错!


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


麻烦大家帮忙看看为什么会出错!
发表于:2007-03-13 11:09:16 楼主
private   void   button1_click(object   sender,   eventargs   e)
                {
                        sqlconnection   thisconnection   =   new   sqlconnection(@ "server=(local);integrated   security   =   true; "   +   "database   =   speed ");

                        thisconnection.open();

                        sqlcommand   thiscommand   =   thisconnection.createcommand();

                        thiscommand.commandtimeout   =   0;

                        string   databasename   =   textbox1.text;

                        thiscommand.commandtext   =   "   declare   @footname   nvarchar

(4000)     set   @footname   =     '移动 "   +databasename   +   " 'EXEC  

speed.dbo.export_newsystem移动1012   @footname   ";      


                        sqldatareader   thisreader5   =   thiscommand.EXECutereader();

                        textbox4.text   =   "好了 ";

                        thisreader5.close();
                }

我是想调用存储过程创建一个新库,但是我这样做老是报错,同样的语句,报过两不同的错。   麻烦各位帮我看看我要怎么改,我是新手,谢谢大家了!
发表于:2007-03-13 12:47:551楼 得分:0
sqlconnection   conn   =   new   sqlconnection(   ....   );
conn.open();
sqlcommand   comm   =   new   sqlcommand();
comm.connection   =   conn;
comm.commandtext   =   .....(sql)
comm.commandtype   =   commandtype.text;
comm.EXECutenonquery();   //执行.....


快速检索

最新资讯
热门点击