No, code generators are increasingly helpful to programmers. There are some excellent code tools on the Internet, such as codesmith and mygeneration. However, I have never found a tool or template that directly converts the Oracle Stored Procedure package to C #. (could anyone tell me? Thank you very much! :), So I wrote coderobot in my work, which is convenient to use. The following describes how to use it:
(1) The generated code is based on the oraclebase class (used for database shutdown and command parameter preprocessing ). Include this class in the project.
(2) The database connection string is saved in the config configuration file of the project by default, for example, <add key = "connstr" value = "Data Source = portal; user id = user; password = pass; "/>
(3) For output parameters of the string type, generate C # code similar to addmediaparamout (CMD, "p_name", oracletype. varchar, # length #);
Code, change # length # To the actual length of the corresponding field
(4) For output parameters of the cursor type, the parameter type genrefcur is ref cursor is defined in Oracle;
Procedure example (p_id int, p_cur out genrefcur );
Generate C # code: Public void example (long p_id, out oracledatareader p_cur)
(5) Use Code such as: Using (dbexample DB = new dbexample)
{
DB. func1 (..);
DB. func2 (..);
}
---------------------------------------------
What's new
---------------------------------------------
Ver 1. 1. * (download)
-You can use Pascal to format the function name and parameter name.
-Fixed the problem that the Oracle 10g DSN list could not be obtained.
Ver 1.0.2764 (download)
-Use icsharpcode. texteditor to display code
Ver 1.0.2448
-Added blob support.
-Simplified oraclebase
Ver 1.0.2167:
-Automatically retrieve the Oracle DSN list
-Support stored procedures (functions)
-Datareader, dataset, and able output are supported.
-Some minor bugs