ExecuteSqlCommand Method
- Last UpdatedAug 21, 2026
- 1 minute read
Use the ExecuteSqlCommand() method to run the SQL command on the database.
'Declaration
Public Function ExecuteSqlCommand( _
ByVal command As String, _
ByVal option As HistorianSqlExecuteOption, _
ByRef returnValue As Integer, _
ByRef dataTable As DataTable, _
ByRef error As HistorianAccessError _
) As Boolean
'Usage
Dim instance As HistorianAccess
Dim command As String
Dim option As HistorianSqlExecuteOption
Dim returnValue As Integer
Dim dataTable As DataTable
Dim error As HistorianAccessError
Dim value As Boolean
value = instance.ExecuteSqlCommand(command, option, returnValue, dataTable, error)
public bool ExecuteSqlCommand(
string command,
HistorianSqlExecuteOption option,
ref int returnValue,
ref DataTable dataTable,
out HistorianAccessError error
)
public:
bool ExecuteSqlCommand(
String^ command,
HistorianSqlExecuteOption option,
int% returnValue,
DataTable^% dataTable,
[Out] HistorianAccessError^ error
)
Parameters
- command
- String holding the command to be executed.
- option
- SQL Execute option.
- returnValue
- Integer holding the return value.
- dataTable
- DataTable object holding the data returned.
- error
- This is the object of HistorianAccessError that stores the error information, if any.
Return Value
Returns true if the operation is successful; otherwise, false.