combit List & Label 24 - .NET Online Web Help
ExecuteDbCommand Event (DbCommandSetDataProvider)
Example 


combit.ListLabel24.DataProviders Namespace > DbCommandSetDataProvider Class : ExecuteDbCommand Event
This event allows to edit the DbCommand before it is executed on the database.
Syntax
'Declaration
 
Public Event ExecuteDbCommand As EventHandler(Of ExecuteDbCommandEventArgs)
public event EventHandler<ExecuteDbCommandEventArgs> ExecuteDbCommand
public:
event EventHandler<ExecuteDbCommandEventArgs^>^ ExecuteDbCommand
Event Data

The event handler receives an argument of type ExecuteDbCommandEventArgs containing data related to this event. The following ExecuteDbCommandEventArgs properties provide information specific to this event.

PropertyDescription
The IDbCommand instance which is to be executed on the database. You can e.g. edit the SQL statement or change the parameter values.  
Example
void MyCommandDataSetProvider_ExecuteDbCommand(object sender, ExecuteDbCommandEventArgs e)
{
  e.Command.CommandText = e.Command.CommandText.Replace("*", "[Address], [CustomerName], [City]");
}
Private Sub MyCommandDataSetProvider_ExecuteDbCommand(sender As Object, e As ExecuteDbCommandEventArgs)
	e.Command.CommandText = e.Command.CommandText.Replace("*", "[Address], [CustomerName], [City]")
End Sub
Requirements

Platforms: Windows Vista - Windows 10 Version 1809, Windows Server 2008 - 2016

See Also