当前位置: 首页>>代码示例>>C#>>正文


C# DatabaseHelper.ExecuteNonQuery方法代码示例

本文整理汇总了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;
			
		}
开发者ID:kimboox44,项目名称:POS,代码行数:39,代码来源:PURPurchaseLineBase.cs


注:本文中的POS.DataLayer.DatabaseHelper.ExecuteNonQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。