Knight Data Access Layer
StoredProcedureExists Method (DataHelper)
Example 




KellermanSoftware.NetDataAccessLayer Namespace > DataHelper Class : StoredProcedureExists Method
The stored procedure to find
Returns true if the passed stored procedure exists in the database
Syntax
Public Overridable Function StoredProcedureExists( _
   ByVal storedProcedureName As String _
) As Boolean
Dim instance As DataHelper
Dim storedProcedureName As String
Dim value As Boolean
 
value = instance.StoredProcedureExists(storedProcedureName)
public virtual bool StoredProcedureExists( 
   string storedProcedureName
)
public: virtual bool StoredProcedureExists( 
   string* storedProcedureName
) 
public:
virtual bool StoredProcedureExists( 
   String^ storedProcedureName
) 

Parameters

storedProcedureName
The stored procedure to find

Return Value

True if the stored procedure exists
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();
 
//This stored procedure does not exist
bool exists = db.StoredProcedureExists("StoredProcedureThatDoesNotExist");
 
//Close the database connection
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()
 
'This stored procedure does not exist
Dim exists As Boolean = db.StoredProcedureExists("StoredProcedureThatDoesNotExist")
 
'Close the database connection
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

DataHelper Class
DataHelper Members