免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
在Vs.net中Ado.net訪問Sybase 12。5數(shù)據(jù)庫總結! - ASP.NET開...
經(jīng)過一個星期的學習,現(xiàn)將自己學習的心得和大家交流一下吧!  
   
                                      Sybase   12.5用Ado.Net訪問總結  
   
  Sybase   12.5—ODBC驅動訪問數(shù)據(jù)庫:出現(xiàn)亂碼。  
  Sybase   12.5—OLEDB驅動訪問數(shù)據(jù)庫:出現(xiàn)亂碼。  
   
  Sybase   12.5—ODBC驅動訪問數(shù)據(jù)庫: 改變字符編碼:iso_1改為:cp850                                               出現(xiàn)亂碼出時Sybase   12.5   —Sql工具顯示亂碼  
  Sybase   12.5—OLEDB驅動訪問數(shù)據(jù)庫:  
                                                                        改變字符編碼:iso_1改為:cp850                                               出現(xiàn)亂碼出時Sybase   12.5   —Sql工具顯示亂碼  
  Sybase   12.5—Sybase   System   11驅動訪問數(shù)據(jù)庫:用ODBC訪問數(shù)據(jù)庫不會出現(xiàn)亂碼。  
   
  代碼:  
   
  private   void   Button1_Click(object   sender,   System.EventArgs   e)  
  {  
  string   StrCon="Driver={Sybase   System   11};Srvr=server;database=Tax;uid=sa;pwd=;";  
  OdbcConnection   Conn=new   OdbcConnection(StrCon);  
  OdbcDataAdapter   Adapter=new   OdbcDataAdapter("select   *   from   BM_SZ   where   SZBM=‘"   +   this.TextBox2.Text   +   "‘",Conn);  
  DataSet   Set=new   DataSet();  
  Adapter.Fill(Set);  
  this.DataGrid1.DataSource=Set;  
  this.DataGrid1.DataBind();  
  }  
   
  //調用Sybase存儲過程  
  private   void   Button2_Click(object   sender,   System.EventArgs   e)  
  {  
  try  
  {  
  string   StrCon="Driver={Sybase   System   11};Srvr=server;database=Tax;uid=sa;pwd=;";  
  OdbcConnection   Conn=new   OdbcConnection(StrCon);  
  Conn.Open();  
  OdbcParameter   Parameter;  
  OdbcCommand   Comm=new   OdbcCommand("{   CALL   test(?)   }",Conn);  
  Comm.CommandType=CommandType.StoredProcedure;  
   
  Parameter=Comm.Parameters.Add("@b",OdbcType.VarChar,10);  
  Parameter.Direction=ParameterDirection.Input;  
  Parameter.Value=this.TextBox1.Text;  
   
   
  OdbcDataReader   Reader=Comm.ExecuteReader();  
  this.DataGrid1.DataSource=Reader;  
  this.DataGrid1   .DataBind();  
  }  
  catch(Exception   Err)  
  {  
  Response.Write(Err.Message);  
  }  
  }
1樓 
那要是sybase11那,怎么通過ado.net或者oledb連接那?
2樓 
OdbcConnection  
  就可以阿,要不然你用12.5的驅動程也是可以的,我以前就用過
3樓 
gz
4樓 
那用OdbcConnection連接sybase   12.5的時候該用什么連接字符串??用Driver={SYBASE   ASE   ODBC   Driver};Srvr=server;database=Tax;uid=sa;pwd=;會出亂碼!連接字符串中添加charset=iso_1后倒是不會出現(xiàn)亂碼問題,但是在傳中文的時候會報錯!類似于這條語句:OdbcDataAdapter   Adapter=new   OdbcDataAdapter("select   *   from   BM_SZ   where   SZBM=‘"   +   this.TextBox2.Text   +   "‘",Conn);其中this.TextBox2.Text是中文,它會報錯:when   String   data   Translation   data   trunctation"    
本站僅提供存儲服務,所有內容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
6.6.1 什么是接口
VB.NET連接數(shù)據(jù)庫的幾種方法
Matlab數(shù)據(jù)庫編程
利用ODBC訪問WINCC的歷史數(shù)據(jù)庫
從java中的hibernate看Ado.net 與NHibernate的關系
VBA與Access數(shù)據(jù)庫的具體連接方式,DAO與ADO的利用
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服