资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

答对给分,如何连接oracle数据库啊,怎么写的?

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

如何连接oracle数据库啊,怎么写的?

网友回答:

发表者:wenww

Dim   strConnect   As   String   =   "Server=192.168.2.109;Database=ShoboDB;User   ID=shobo;Password=shobo;"  
   
                  Dim   objConnection   As   SqlConnection   =   New   SqlConnection(strConnect)  
   
                  objConnection.Open()  
                  Dim   objCommand   As   SqlCommand   =   New   SqlCommand()  
   
                  objCommand.Connection   =   objConnection  
                  objCommand.CommandType   =   CommandType.Text  
                  Dim   sda   As   SqlDataAdapter   =   New   SqlDataAdapter()  
                  Dim   sda   As   New   SqlDataAdapter(objCommand,   objConnection)  
                  sda.SelectCommand   =   objCommand  
                  Dim   ds   As   DataSet   =   New   DataSet()  
   
                  strSql   =   "Select   *   From   smg_kaib   "  
                  objCommand.CommandText   =   strSql  
                  sda.Fill(ds)  
                  DataGrid1.PageSize   =   5  
                  DataGrid1.PagerStyle.HorizontalAlign   =   HorizontalAlign.Right  
                  DataGrid1.PagerStyle.PageButtonCount   =   3  
                  DataGrid1.PagerStyle.Mode   =   PagerMode.NumericPages  
                  DataGrid1.PagerStyle.Mode   =   PagerMode.NextPrev  
                  DataGrid1.PagerStyle.NextPageText   =   "next   page"  
                  DataGrid1.PagerStyle.PrevPageText   =   "last   page"  
   
                  DataGrid1.DataSource   =   ds  
                  DataGrid1.DataBind()  
   
                  objConnection.Close()  
 


 

 
热门推荐笔记本: 宏碁笔记本
相关文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved