本文整理汇总了C#中POS.DataLayer.DatabaseHelper.ExecuteNonQuery方法的典型用法代码示例。如果您正苦于以下问题:C# DatabaseHelper.ExecuteNonQuery方法的具体用法?C# DatabaseHelper.ExecuteNonQuery怎么用?C# DatabaseHelper.ExecuteNonQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类POS.DataLayer.DatabaseHelper
的用法示例。
在下文中一共展示了DatabaseHelper.ExecuteNonQuery方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteAllByForeignKeyPurchaseHeaderID
/// <summary>
/// This method will delete row(s) from the database using the value of the field specified
/// along with the details of the child table.
/// </summary>
///
/// <param name="pk" type="PURPurchaseHeaderPrimaryKey">Primary Key information based on which data is to be deleted.</param>
///
/// <returns>object of boolean type as an indicator for operation success .</returns>
///
/// <remarks>
///
/// <RevisionHistory>
/// Author Date Description
/// DLGenerator 3/7/2015 2:37:18 PM Created function
///
/// </RevisionHistory>
///
/// </remarks>
///
public static bool DeleteAllByForeignKeyPurchaseHeaderID(PURPurchaseHeaderPrimaryKey pk)
{
DatabaseHelper oDatabaseHelper = new DatabaseHelper();
bool ExecutionState = false;
// Pass the values of all key parameters to the stored procedure.
System.Collections.Specialized.NameValueCollection nvc = pk.GetKeysAndValues();
foreach (string key in nvc.Keys)
{
oDatabaseHelper.AddParameter("@" + key,nvc[key] );
}
// The parameter '@dlgErrorCode' will contain the status after execution of the stored procedure.
oDatabaseHelper.AddParameter("@dlgErrorCode", -1, System.Data.ParameterDirection.Output);
oDatabaseHelper.ExecuteNonQuery("gsp_PURPurchaseLine_DeleteAllByForeignKeyPurchaseHeaderID", ref ExecutionState);
oDatabaseHelper.Dispose();
return ExecutionState;
}