CleanCode C# Libraries v0.9.30 API

SqlEditor Class

A practical SQL edit window and output result grid in one control.

For a list of all members of this type, see SqlEditor Members.

System.Object
   MarshalByRefObject
      Component
         Control
            ScrollableControl
               ContainerControl
                  UserControl
                     SqlEditor

public class SqlEditor : UserControl, IDisplayCommands, IResourceUser

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

SqlEditor -- click for full size This control is a true SQL-editor-in-a-box. Drag it onto your Windows Form and you have a fully functioning editor that may be configured at runtime to connect to any number of different servers and database types (it supports SQL Server, Oracle, and any ODBC data source). Once you define a set of connections in the connection editor, you may export the list and then import it into another copy of the application running on other machines. Click on the thumbnail at right for a screenshot of the SqlEditor.

This control is built on top of several other custom building blocks. A ChameleonRichTextBox provides the editing pane and an ExtendedDataGridView displays the output results. Each of those child controls plus this control itself performs a variety of commands by keystroke, mouse, menu, or context menu. To provide an aid to using them, each provides a pop-up reference detailing all the commands. You need only hook up the ShowUserCommands method of each to display this. Another major child control is the MultiConnectionStringManager, which provides the connection editor that lets you define database connections, test the connections, encrypts passwords when stored, and imports/exports the connection list.

This control has built-in support for synchronizing its actions with a partner. That is, instantiate two copies of this control and they can scroll together, load files together, and change settings together, once you enable tandem operation (TandemMode and Partner). Features that work in tandem are listed here. The user may override the tandem mode setting (either on or off) for a single action simply by depressing the Ctrl key when performing an action.

This class is instrumented with a StructuredTraceSource for diagnostic output. Its key name defaults to SqlEditor. However, if you assign a Partner property, the key name becomes the Name property of the instance in order to allow distinguishing instances in the diagnostic output.

Since CleanCode 0.9.23.

Requirements

Namespace: CleanCode.SqlEditorControls

Assembly: CleanCode.SqlEditorControls (in CleanCode.SqlEditorControls.dll)

See Also

SqlEditor Members | CleanCode.SqlEditorControls Namespace