Knight Data Access Layer
ExecuteNonQuerySproc(String,IEnumerable<Object>) Method
Example 




KellermanSoftware.NetDataAccessLayer Namespace > IDataHelper Interface > ExecuteNonQuerySproc Method : ExecuteNonQuerySproc(String,IEnumerable<Object>) Method
The stored procedure to execute
The parameters for the stored procedure
Execute the passed stored procedure and return the number of affected records
Syntax
Overloads Function ExecuteNonQuerySproc( _
   ByVal storedProcedure As String, _
   ByVal nameValueParameters As IEnumerable(Of Object) _
) As Integer
Dim instance As IDataHelper
Dim storedProcedure As String
Dim nameValueParameters As IEnumerable(Of Object)
Dim value As Integer
 
value = instance.ExecuteNonQuerySproc(storedProcedure, nameValueParameters)
int ExecuteNonQuerySproc( 
   string storedProcedure,
   IEnumerable<object> nameValueParameters
)

Parameters

storedProcedure
The stored procedure to execute
nameValueParameters
The parameters for the stored procedure

Return Value

Number of affected records
Example
//Get the current thread static safe instance of the helper
SqlServerProvider provider = new SqlServerProvider();
 
//Specify User Name and License Key from the receipt, leave blank for trial mode
//db.UserName = "John Smith 1234";
//db.LicenseKey = "asdfl219==";
 
//Log to the console
db.EnableLogging();
 
//Open the database connection
db.OpenConnection();
 
string storedProcedure = "NightlyBatch";
 
int results = _db.ExecuteNonQuerySproc(storedProcedure, , new object[] {"ExpirationType", "Credit Card" });
 
db.CloseConnection();
'Get the current thread static safe instance of the helper
Dim provider As New SqlServerProvider()
 
'Specify User Name and License Key from the receipt, leave blank for trial mode
'db.UserName = "John Smith 1234"
'db.LicenseKey = "asdfl219=="
 
'Log to the console
db.EnableLogging()
 
'Open the database connection
db.OpenConnection()
 
Dim storedProcedure As String = "NightlyBatch"
 
Dim results As Integer = _db.ExecuteNonQuerySproc(storedProcedure, new object[] {"ExpirationType", "Credit Card" })
 
db.CloseConnection()
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

IDataHelper Interface
IDataHelper Members
Overload List