存储过程调用 的生产可以生产 C#、VB 以及我们一直以来都支持的F#和IronPython。
下面是相关示例 , 目前正在优化和增强。
//
------------------------------------------------------------------------------
//
//
此代码由工具生成。
//
运行时版本:2.0.50727.3053
//
//
对此文件的更改可能会导致不正确的行为,并且如果
//
重新生成代码,这些更改将会丢失。
//
//
------------------------------------------------------------------------------
//
生成日期:20090510211640
namespace
SP {
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Text;
using
Keel.ORM;
public
class
SP {
public
int
SP_Codfiles_DeleteByPK_ExecuteNonQuery(
string
@Filemd5) {
Keel.DBHelper
<
int
>
dbi
=
new
Keel.DBHelper
<
int
>
();
string
[] names
=
new
string
[] {
"
@Filemd5
"
};
object
[] values
=
new
object
[] {
@Filemd5};
int
i
=
dbi.ExcStoredProcedure(
"
SP_Codfiles_DeleteByPK
"
, Keel.SPExcMethod.ExecuteNonQuery, names, values);
return
i;
}
public
int
SP_Codsoftitem_Insert_ExecuteNonQuery(
string
@CodFileMd5,
string
@FullName,
string
@SoftName,
string
@Version,
int
@Size, System.DateTime @Created,
int
@Score_Good,
int
@Score_Bad,
int
@Money, System.DateTime @UploadDateTime,
string
@PhoneTypes,
string
@PhoneOS) {
Keel.DBHelper
<
int
>
dbi
=
new
Keel.DBHelper
<
int
>
();
string
[] names
=
new
string
[] {
"
@CodFileMd5
"
,
"
@FullName
"
,
"
@SoftName
"
,
"
@Version
"
,
"
@Size
"
,
"
@Created
"
,
"
@Score_Good
"
,
"
@Score_Bad
"
,
"
@Money
"
,
"
@UploadDateTime
"
,
"
@PhoneTypes
"
,
"
@PhoneOS
"
};
object
[] values
=
new
object
[] {
@CodFileMd5,
@FullName,
@SoftName,
@Version,
@Size,
@Created,
@Score_Good,
@Score_Bad,
@Money,
@UploadDateTime,
@PhoneTypes,
@PhoneOS};
int
i
=
dbi.ExcStoredProcedure(
"
SP_Codsoftitem_Insert
"
, Keel.SPExcMethod.ExecuteNonQuery, names, values);
return
i;
}
public
int
SP_User_Insert_ExecuteNonQuery(
string
@Username,
string
@Password,
string
@Phonetype,
string
@Email) {
Keel.DBHelper
<
int
>
dbi
=
new
Keel.DBHelper
<
int
>
();
string
[] names
=
new
string
[] {
"
@Username
"
,
"
@Password
"
,
"
@Phonetype
"
,
"
@Email
"
};
object
[] values
=
new
object
[] {
@Username,
@Password,
@Phonetype,
@Email};
int
i
=
dbi.ExcStoredProcedure(
"
SP_User_Insert
"
, Keel.SPExcMethod.ExecuteNonQuery, names, values);
return
i;
}
}
}
///
/// 存储过程调用
///
///
存储过程名称
///
支持 ExecuteScalar 、 Fill、 Model 、ExecuteNonQuery 、List 五种方法
///
根据执行方法不同返回值不同
///
ExecuteScalar 支持任何基本类型
///
ExecuteNonQuery仅仅支持 int
///
Fill中支持 DataTable和 DataSet
///
List 方法支持int类型,返回值在 ,out List
drlt中返回
public
T ExcStoredProcedure(
string
spname, SPExcMethod sp_exctype,
out
List
<
T
>
drlt,
string
[] names , Array ary )
{
--------------------------
新闻: 七大IT狂热门派,你属于哪一派?
网站导航: 博客园首页 新闻 .NET频道 社区 博问 闪存 找找看