Using DbCommandEditor in my own control

Discussion in 'ASP .Net Building Controls' started by Francois Grobler, Oct 6, 2003.

  1. I am writing a user control that needs to mimic some of the functionality
    contained in the DataAdapter control. I need to display a list of Command
    objects on the control container in the Property Browser of the control,
    very similar to selecting a command for the DataAdapter control.

    Normally this would be done by using a TypeConverter Attribute or an Editor
    Attribute on the property, except that it seems that Microsoft did not
    expose the Editor that they use in the DataAdapter in the Dot NET Framework.
    My property is of the Type IDBCommand, and I therefore require either an
    Editor for this Type, or a TypeConverter for this Type, or both.

    I have had a look at the System.Data Assembly in ildasm and found that the
    correct Editor to use is the
    Microsoft.VSDesigner.Data.Design.DBCommandEditor.
    (I also similarly need access to the
    Microsoft.VSDesigner.Data.Design.DBConnectionEditor.)

    I then set a reference to the Microsoft.VSDesigner.dll assembly in the
    \Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE folder. When I
    run my control in the design view however it does not display this editor,
    but a blank dropdown.
    Is there a different Editor that can be used, is there a way to access these
    editors or are they reserved for use by the Microsoft developers on the VS
    IDE only?

    The dropdown obviously work when I change the property type to
    SQLClient.SQLCommand, then I get the dropdown showing the sql commands on
    the control container. The point is that I would like to display any
    command type not a specific command (any object that implemented the
    idbcommand interface).

    I further would like to know whether these assemblies are redistributable.

    Here is a snippet of the property code:

    <Category("Data"), _
    Description("The data command object to use to obtain data."), _
    Editor("Microsoft.VSDesigner.Data.Design.DBCommandEditor,
    Microsoft.VSDesigner", GetType(System.Drawing.Design.UITypeEditor))> _
    Public Property DataCommand() As IDbCommand
    Get
    Return _DataCommand
    End Get
    Set(ByVal Value As IDbCommand)
    _DataCommand = Value
    End Set
    End Property
    Francois Grobler, Oct 6, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stefan Siegl
    Replies:
    1
    Views:
    771
  2. Saverio M.
    Replies:
    0
    Views:
    512
    Saverio M.
    Jul 3, 2006
  3. David

    Get Value of a control from my Own Control

    David, Apr 6, 2005, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    100
    Nick Stansbury
    Apr 7, 2005
  4. David

    Get Value of a control from my Own Control

    David, Apr 6, 2005, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    122
    Brock Allen
    Apr 7, 2005
  5. David Filmer
    Replies:
    17
    Views:
    259
    J. Romano
    Aug 18, 2004
Loading...

Share This Page