Update NBearLite to v1.0.0.6 beta
Fully supports SQL Server, Oracle, MySql, and PostgreSql database Stored Procedure Call code generation (C #/VB. NET) and various parameter types such as input, output, and return.
Sub Query is supported.
Save able/DataRow is supported.
See: http://www.cnblogs.com/teddyma/archive/2007/07/20/825384.html
Introduction
Use nbearlite.querycolumnsgenerator.exe and specify the target database type and connection string. The generated Stored Procedure Call code is similar to the following:
1 public static System. Data. DataSet SalesByCategoryTest (NBearLite. Database db, out int RETURN_VALUE, string CategoryName, string OrdYear, ref string OutP ){
2 if (db = null )){
3 throw new System. ArgumentNullException ("db", "Parameter: db cocould not be null! ");
4}
5 NBearLite. StoredProcedureSection spSection = db. StoredProcedure ("SalesByCategoryTest ");
6 System. Collections. Generic. Dictionary <string, object> outValues;
7 spSection. SetReturnParameter ("RETURN_VALUE", System. Data. DbType. Int32, 0 );
8 spSection. AddInputParameter ("CategoryName", System. Data. DbType. String, CategoryName );
9 spSection. AddInputParameter ("OrdYear", System. Data. DbType. String, OrdYear );
10 spSection. AddInputOutputParameter ("OutP", System. Data. DbType. String, 5, OutP );
11 System. Data. DataSet ds = spSection. ToDataSet (out outValues );
12 RETURN_VALUE = (int) (outValues ["RETURN_VALUE"]);
13 OutP = (string) (outValues ["OutP"]);
14 return ds;
15}
Example of calling this Code:
Int ret =-1;
String outStr = "";
DataSet ds = Northwind. SalesByCategoryTest (db, out ret, "test1", "1997", ref outStr );
The stored procedure SalesByCategoryTest contains four parameters: two inputs, one output (corresponding to the out parameter), one input and output parameter (corresponding to the ref parameter), and one DataSet.
For more information about NBearLite, visit: Workshop.
Appendix: NBearV4 advance notice and collection of development team members