How to remove tables from the Data Wizard

Hi,

I have some code that only includes some tables for the data connection. But, as soon as I go into the Data Wizard to create a new DataSource, all of the tables appear, instead of only the tables that I want the user to see.

How can I limit which tables that the user can see in the Data Wizard and the Query Builder?

Daniel Rail

Comments

  • edited 10:37PM
    Hello,

    You may use the Config.DesignerSettings.FilterConnectionTables event to filter unnecessary tables. Here is the example in the Class Reference:

    /// <summary>
    /// Occurs when getting available table names from the connection.
    /// </summary>
    /// <remarks>
    /// Use this handler to filter the list of tables returned by the connection object.
    /// </remarks>
    /// <example>
    /// This example demonstrates how to hide the table with "Table 1" name from the Data Wizard.
    /// <code>
    /// Config.DesignerSettings.FilterConnectionTables += DesignerSettings_FilterConnectionTables;
    ///
    /// private void DesignerSettings_FilterConnectionTables(object sender, FilterConnectionTablesEventArgs e)
    /// {
    /// if (e.TableName == "Table 1")
    /// e.Skip = true;
    /// }
    /// </code>
    /// </example>
  • edited 10:37PM
    AlexTZ wrote: »
    Hello,

    You may use the Config.DesignerSettings.FilterConnectionTables event to filter unnecessary tables. Here is the example in the Class Reference:

    /// Config.DesignerSettings.FilterConnectionTables += DesignerSettings_FilterConnectionTables;
    ///
    /// private void DesignerSettings_FilterConnectionTables(object sender, FilterConnectionTablesEventArgs e)
    /// {
    /// if (e.TableName == "Table 1")
    /// e.Skip = true;
    /// }

    Thanks a lot. It works. Maybe, you can add it to the Programmer's Manual, because that was the first obvious place that I look at, as a quick reference.

    Daniel
  • edited 10:37PM
    Ok, I will add the topic in the next major build.

Leave a Comment