乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      在Vs.net中Ado.net訪問Sybase 12。5數(shù)據(jù)庫總結(jié)! - ASP.NET開...

       johnlane 2007-06-30
      經(jīng)過一個(gè)星期的學(xué)習(xí),現(xiàn)將自己學(xué)習(xí)的心得和大家交流一下吧!  
         
                                            Sybase   12.5用Ado.Net訪問總結(jié)  
         
        Sybase   12.5—ODBC驅(qū)動(dòng)訪問數(shù)據(jù)庫:出現(xiàn)亂碼。  
        Sybase   12.5—OLEDB驅(qū)動(dòng)訪問數(shù)據(jù)庫:出現(xiàn)亂碼。  
         
        Sybase   12.5—ODBC驅(qū)動(dòng)訪問數(shù)據(jù)庫: 改變字符編碼:iso_1改為:cp850                                               出現(xiàn)亂碼出時(shí)Sybase   12.5   —Sql工具顯示亂碼  
        Sybase   12.5—OLEDB驅(qū)動(dòng)訪問數(shù)據(jù)庫:  
                                                                              改變字符編碼:iso_1改為:cp850                                               出現(xiàn)亂碼出時(shí)Sybase   12.5   —Sql工具顯示亂碼  
        Sybase   12.5—Sybase   System   11驅(qū)動(dòng)訪問數(shù)據(jù)庫:用ODBC訪問數(shù)據(jù)庫不會(huì)出現(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();  
        }  
         
        //調(diào)用Sybase存儲(chǔ)過程  
        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的驅(qū)動(dòng)程也是可以的,我以前就用過
      3樓 
      gz
      4樓 
      那用OdbcConnection連接sybase   12.5的時(shí)候該用什么連接字符串??用Driver={SYBASE   ASE   ODBC   Driver};Srvr=server;database=Tax;uid=sa;pwd=;會(huì)出亂碼!連接字符串中添加charset=iso_1后倒是不會(huì)出現(xiàn)亂碼問題,但是在傳中文的時(shí)候會(huì)報(bào)錯(cuò)!類似于這條語句:OdbcDataAdapter   Adapter=new   OdbcDataAdapter("select   *   from   BM_SZ   where   SZBM=‘"   +   this.TextBox2.Text   +   "‘",Conn);其中this.TextBox2.Text是中文,它會(huì)報(bào)錯(cuò):when   String   data   Translation   data   trunctation"    

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請遵守用戶 評(píng)論公約

        類似文章 更多