当前位置:首页 » 手机数码

oleDbCommand1.ExecuteScalar() 转为int的问题!!!

八月 23rd, 2007 by admin

热门软件下载:


         

我用c#制作了一个   web项目,后台数据库使用的是oracle,当我制作了一个登陆界面,代码如下:  
  string   sc="select   count(*)     from   users   where(uno=   "+textbox1.text   +")   and   (upassword   =   "+textbox2.text   +")   and   (id=   "+dropdownlist1.selecteditem.text+")";  
  int   i;  
                                                  oledbconnection1.open();  
  oledbcommand1.commandtext=sc;  
  i=(int)oledbcommand1.executescalar();  
                                                  if(i!=0)  
   
  {  
   
   
  if(dropdownlist1.selecteditem.text=="学生")  
  {      
   
  response.redirect("welcome.aspx");  
                                                                  }  
                                                  }  
  调试时,系统报错,说oledbcommand1.executescalar()无法显式转为int   型,但使用sql   server数据库时sqlcommand1.executescalar却可以,请问哪位大虾知道这是怎么一回事?怎样才能将oledbcommand1.executescalar()转为int型???

.

推荐阅读

  • 荷兰试想让互联网摆脱美国ICANN控制 [详细内容]
  • 奇幻游戏《混乱团队》游戏截图 [详细内容]
  • T68/T68ie 技巧 [详细内容]
  • 系统介绍服务器数据备份技术 [详细内容]
  • 日本《天堂II》公测首日发生混乱 [详细内容]
  • 我的心得 [详细内容]
  • “超级女声 超级漂亮”女明星代言手机大导购 [详细内容]
  • 网友回答:


             

    Posted in IT |

    留言系统已关闭