combit List & Label 29 - .NET Help
combit.Reporting.DataProviders Namespace / DbCommandSetDataProvider Class / AddCommand Method / AddCommand(IDbCommand,String) Method

The command to add.

The name for the resulting table.



In This Topic
    AddCommand(IDbCommand,String) Method
    In This Topic
    Adds a command to the provider, resulting in an additional table in the Designer.
    Syntax
    'Declaration
     
    
    Public Overloads Sub AddCommand( _
       ByVal command As IDbCommand, _
       ByVal tableName As String _
    ) 
    public void AddCommand( 
       IDbCommand command,
       string tableName
    )
    public:
    void AddCommand( 
       IDbCommand^ command,
       String^ tableName
    ) 

    Parameters

    command

    The command to add.

    tableName

    The name for the resulting table.

    Example
    OleDbCommand command = new OleDbCommand("Select * from [Customers]", conn);
    OleDbCommand command2 = new OleDbCommand("Select * from [Orders]", conn);
    
    DbCommandSetDataProvider provider = new DbCommandSetDataProvider();
    provider.AddCommand(command, "Customers");
    provider.AddCommand(command2, "Orders");
    provider.AddRelation("Customers2Orders", "Customers", "Orders", "CustomerID", "CustomerID");
    
    LL.DataSource = provider;
    LL.Design();
    
    Dim command As New OleDbCommand("Select * from [Customers]", conn)
    Dim command2 As New OleDbCommand("Select * from [Orders]", conn)
    
    Dim provider As New DbCommandSetDataProvider()
    provider.AddCommand(command, "Customers")
    provider.AddCommand(command2, "Orders")
    provider.AddRelation("Customers2Orders", "Customers", "Orders", "CustomerID", "CustomerID")
    
    LL.DataSource = provider
    LL.Design()
    

     

    Requirements

    Platforms: Windows 10 (Version 21H2 - 23H2), Windows 11 (21H2 - 22H2), Windows Server 2016 - 2022
    .NET: .NET Framework 4.8, .NET 6, .NET 7, .NET 8

    See Also