本文整理汇总了C#中StoredProcedure类的典型用法代码示例。如果您正苦于以下问题:C# StoredProcedure类的具体用法?C# StoredProcedure怎么用?C# StoredProcedure使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StoredProcedure类属于命名空间,在下文中一共展示了StoredProcedure类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BaoCaoSoTruc
private StoredProcedure BaoCaoSoTruc(DateTime? pFromDate, DateTime? pToDate)
{
var sp = new StoredProcedure("GTVT_BAOCAO_SOTRUC", DataService.GetInstance("ORM"), "dbo");
sp.Command.AddParameter("@FromDate", pFromDate, DbType.DateTime, null, null);
sp.Command.AddParameter("@ToDate", pToDate, DbType.DateTime, null, null);
return sp;
}
示例2: DeletePin
public StoredProcedure DeletePin(int BIMID,int UserID)
{
StoredProcedure sp=new StoredProcedure("DeletePin",this.Provider);
sp.Command.AddParameter("BIMID",BIMID,DbType.Int32);
sp.Command.AddParameter("UserID",UserID,DbType.Int32);
return sp;
}
示例3: SqlQueryDataSet
/// <summary>
/// Execute Sql Query with Parameters
/// </summary>
/// <param name="sData">StoredProcedure Class</param>
/// <returns></returns>
public static DataSet SqlQueryDataSet(StoredProcedure sData)
{
DataSet sqlDataView = new DataSet();
try
{
SqlConnection conn = new SqlConnection(connect());
SqlCommand sqlcomm = new SqlCommand(sData.ProcName, conn);
sqlcomm.CommandType = CommandType.StoredProcedure;
int i = 0;
IEnumerator myEnumerator = sData.GetParams().GetEnumerator();
while (myEnumerator.MoveNext())
{
ParamData pData = (ParamData)myEnumerator.Current;
sqlcomm.Parameters.Add(pData.pName, pData.pDataType);
sqlcomm.Parameters[i].Value = pData.pValue;
i = i + 1;
}
SqlDataAdapter sqlAdapterView = new SqlDataAdapter(sqlcomm);
sqlAdapterView.Fill(sqlDataView);
return sqlDataView;
}
catch (Exception ex)
{
HttpContext.Current.Response.Write(ex);
HttpContext.Current.Response.End();
return sqlDataView;
}
}
示例4: TestBasicParsing
public void TestBasicParsing()
{
string proc1 = "CREATE PROC mysp @arg int=1 AS select 1\n";
var sp = new StoredProcedure(proc1);
WVPASSEQ(sp.name, "mysp");
var args = sp.args.ToArray();
WVPASSEQ(args[0].name, "arg");
WVPASSEQ(args[0].type, "int");
WVPASSEQ(args[0].defval, "1");
string proc2 = "CREATE PROC [mysp2]\[email protected] int output ,\n" +
" @arg2 varchar(10) = 'asdf',@arg3 money AS ";
sp = new StoredProcedure(proc2);
WVPASSEQ(sp.name, "[mysp2]");
args = sp.args.ToArray();
WVPASSEQ(args[0].name, "arg1");
WVPASSEQ(args[0].type, "int");
WVPASSEQ(args[0].defval, "");
WVPASSEQ(args[1].name, "arg2");
WVPASSEQ(args[1].type, "varchar(10)");
WVPASSEQ(args[1].defval, "'asdf'");
WVPASSEQ(args[2].name, "arg3");
WVPASSEQ(args[2].type, "money");
WVPASSEQ(args[2].defval, "");
}
示例5: aspnet_Membership_GetNumberOfUsersOnline
public StoredProcedure aspnet_Membership_GetNumberOfUsersOnline(string ApplicationName,int MinutesSinceLastInActive,DateTime CurrentTimeUtc){
StoredProcedure sp=new StoredProcedure("aspnet_Membership_GetNumberOfUsersOnline",this.Provider);
sp.Command.AddParameter("ApplicationName",ApplicationName,DbType.String);
sp.Command.AddParameter("MinutesSinceLastInActive",MinutesSinceLastInActive,DbType.Int32);
sp.Command.AddParameter("CurrentTimeUtc",CurrentTimeUtc,DbType.DateTime);
return sp;
}
示例6: UpdatePrize
public StoredProcedure UpdatePrize(int UserID,int RWPointDed)
{
StoredProcedure sp=new StoredProcedure("UpdatePrize",this.Provider);
sp.Command.AddParameter("UserID",UserID,DbType.Int32);
sp.Command.AddParameter("RWPointDed",RWPointDed,DbType.Int32);
return sp;
}
示例7: GetUser
public StoredProcedure GetUser(string Email,string Password)
{
StoredProcedure sp=new StoredProcedure("GetUser",this.Provider);
sp.Command.AddParameter("Email",Email,DbType.AnsiString);
sp.Command.AddParameter("Password",Password,DbType.AnsiString);
return sp;
}
示例8: aspnet_Membership_GetAllUsers
public StoredProcedure aspnet_Membership_GetAllUsers(string ApplicationName,int PageIndex,int PageSize){
StoredProcedure sp=new StoredProcedure("aspnet_Membership_GetAllUsers",this.Provider);
sp.Command.AddParameter("ApplicationName",ApplicationName,DbType.String);
sp.Command.AddParameter("PageIndex",PageIndex,DbType.Int32);
sp.Command.AddParameter("PageSize",PageSize,DbType.Int32);
return sp;
}
示例9: GetCategory
public static DataTable GetCategory(int p_CategoryID)
{
StoredProcedure sp = new StoredProcedure("p_Categories_s");
sp["@CategoryID"].Value = p_CategoryID;
return sp.ExecuteDataTable();
}
示例10: UpdatePoints
public StoredProcedure UpdatePoints(int UserID,string PointsName)
{
StoredProcedure sp=new StoredProcedure("UpdatePoints",this.Provider);
sp.Command.AddParameter("UserID",UserID,DbType.Int32);
sp.Command.AddParameter("PointsName",PointsName,DbType.AnsiString);
return sp;
}
示例11: AllByParent
public static DataTable AllByParent(int? p_ParentCategoryID, bool p_ShowDisable)
{
StoredProcedure sp = new StoredProcedure("p_Categories_sl_ByParent");
sp["@ParentCategoryID"].Value = p_ParentCategoryID==null?DBNull.Value:(object)p_ParentCategoryID;
sp["@ShowDisable"].Value = p_ShowDisable;
return sp.ExecuteDataTable();
}
示例12: AllCategoriesDrugsByParent
public static DataTable AllCategoriesDrugsByParent(int? p_ParentCategoryID, bool p_isShowAll)
{
StoredProcedure sp = new StoredProcedure("p_CategoriesDrugs_sl_ByParent");
sp["@CategoryID"].Value = p_ParentCategoryID == null ? DBNull.Value : (object)p_ParentCategoryID;
sp["@ShowAll"].Value = p_isShowAll;
return sp.ExecuteDataTable();
}
示例13: BaocaoSoghichep
private StoredProcedure BaocaoSoghichep(DateTime? pFromDate, DateTime? pToDate)
{
SubSonic.StoredProcedure sp = new StoredProcedure("spSoGhiChep", DataService.GetInstance("ORM"), "dbo");
sp.Command.AddParameter("@pFromDate",pFromDate,DbType.DateTime,null,null);
sp.Command.AddParameter("@pToDate",pToDate,DbType.DateTime,null,null);
return sp;
}
示例14: GenerateDocumentCode
internal static StoredProcedure GenerateDocumentCode(string transactionType)
{
//TODO : XML config for SP name
StoredProcedure sp = new StoredProcedure("GenerateDocumentCode");
sp.AddParameter("@TransactionType", StoredProcedure.ParameterType.String, 30, transactionType);
return sp;
}
示例15: AddBoardContributor
public StoredProcedure AddBoardContributor(string User,int BoardID)
{
StoredProcedure sp=new StoredProcedure("AddBoardContributor",this.Provider);
sp.Command.AddParameter("User",User,DbType.AnsiString);
sp.Command.AddParameter("BoardID",BoardID,DbType.Int32);
return sp;
}