發布Oracle預存程序包c#代碼產生工具(CodeRobot)

來源:互聯網
上載者:User
    無可致否,代碼產生器對於程式員的協助是越來越大。網上出現了一些優秀的代碼工具,比較出名的如:CodeSmith, MyGeneration。但我一直沒有找到直接將oracle預存程序包轉化為c#的工具或模板(有誰知道告知我啊非常感謝!:),故在工作中編寫了CodeRobot這個小冬冬>,使用起來是比較方便的。以下簡要說明一下使用方法:

    (1)產生的程式碼基於OracleBase類(用於資料庫開閉及command參數預先處理)。請將該類包含進工程。
    (2)資料庫連接字串預設儲存在工程的config設定檔中,如         <add key="ConnStr" value="data source=portal; user id=user; password=pass;"/>

    (3)對於字串類型的輸出參數,在產生C#代碼類似         AddCmdParamOut(cmd, "P_NAME", OracleType.VarChar, #length#);

         的代碼,請將#length#改成對應欄位的實際長度
    (4)對於遊標類型的輸出參數,在oracle中定義為:         type genrefcur is ref cursor;
         procedure example(p_id int, p_cur out genrefcur);

         則產生C#代碼為:         public void EXAMPLE(long P_ID, out OracleDataReader P_CUR)

    (5)使用代碼如:         using (DbExample db = new DbExample)
         {
             db.FUNC1(..);
             db.FUNC2(..);
         }

 

---------------------------------------------
What's new
---------------------------------------------
Ver 1.1.* (下載)
    - 可使用Pascal格式化函數名和參數名
    - 修正無法擷取 oracle 10g dsn列表的問題

Ver 1.0.2764 (下載)
    - 使用ICSharpCode.TextEditor 展現代碼

Ver 1.0.2448
    - 添加Blob支援
    - 簡化OracleBase

Ver 1.0.2167:
    - 自動擷取oracle dsn列表
    - 支援預存程序(函數)
    - 支援DataReader, DataSet, DataTable輸出
    - 一些小bug

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.