Class ConnectionParamsControl
Reusable connection assistant. Lets the user pick a .Net provider (driver), edits its connection parameters dynamically through the provider's own DbConnectionStringBuilder bound to a PropertyGrid (works for ANY registered provider), shows the resulting connection string and tests the connection. The only persisted value is the connection string plus the provider factory invariant name (no JSON).
Inheritance
Implements
Inherited Members
Namespace: Reportman.Designer
Assembly: Reportman.Designer.dll
Syntax
public class ConnectionParamsControl : UserControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl
Constructors
View SourceConnectionParamsControl()
Declaration
public ConnectionParamsControl()
Fields
View SourceHTTP_AGENT
Synthetic combo entry that selects the Reportman HTTP Agent "driver".
Declaration
public const string HTTP_AGENT = "__HTTPAGENT__"
Field Value
| Type | Description |
|---|---|
| string |
Properties
View SourceAgentApiKey
Agent API key (only meaningful in agent mode).
Declaration
public string AgentApiKey { get; }
Property Value
| Type | Description |
|---|---|
| string |
AgentBaseUrl
Agent base URL (only meaningful in agent mode).
Declaration
public string AgentBaseUrl { get; }
Property Value
| Type | Description |
|---|---|
| string |
AgentDatabaseName
Selected Hub database display name (only meaningful in agent mode).
Declaration
public string AgentDatabaseName { get; }
Property Value
| Type | Description |
|---|---|
| string |
AgentHubDatabaseId
Selected Hub database id (only meaningful in agent mode).
Declaration
public long AgentHubDatabaseId { get; }
Property Value
| Type | Description |
|---|---|
| long |
ConnectionString
Resulting connection string (decoded/encoded through the builder).
Declaration
public string ConnectionString { get; }
Property Value
| Type | Description |
|---|---|
| string |
IsHttpAgent
True when the HTTP Agent "driver" is selected.
Declaration
public bool IsHttpAgent { get; }
Property Value
| Type | Description |
|---|---|
| bool |
LastOk
Last test connection outcome: null=not tested, true/false.
Declaration
public bool? LastOk { get; }
Property Value
| Type | Description |
|---|---|
| bool? |
LastResultText
Last test connection result message (for diagnostics/screenshots).
Declaration
public string LastResultText { get; }
Property Value
| Type | Description |
|---|---|
| string |
ProviderInvariant
Provider factory invariant name currently selected.
Declaration
public string ProviderInvariant { get; }
Property Value
| Type | Description |
|---|---|
| string |
SelectedProviderDisplay
Display text of the currently selected provider.
Declaration
public string SelectedProviderDisplay { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
View SourcePopulate(string, string)
Initialize the control with an existing provider + connection string (decodes the connection string into the parameter grid).
Declaration
public void Populate(string providerInvariant, string connectionString)
Parameters
| Type | Name | Description |
|---|---|---|
| string | providerInvariant | |
| string | connectionString |
PopulateHttpAgent(string, string, long, string)
Pre-fill the agent fields (used when editing an existing agent connection).
Declaration
public void PopulateHttpAgent(string apiKey, string baseUrl, long hubDatabaseId, string databaseName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | apiKey | |
| string | baseUrl | |
| long | hubDatabaseId | |
| string | databaseName |
ScrollToTop()
Scroll the parameter grid to the first property (top).
Declaration
public void ScrollToTop()
SelectHttpAgent()
Select the HTTP Agent "driver" entry and switch the grid to agent params.
Declaration
public void SelectHttpAgent()
TestConnection()
Run the connection test programmatically (used by /dbconfig screenshots).
Declaration
public void TestConnection()