本文整理匯總了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;
}