Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Using DbCommandEditor in my own control

Reply
Thread Tools

Using DbCommandEditor in my own control

 
 
Francois Grobler
Guest
Posts: n/a
 
      10-06-2003
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.DBConnectionEdito r.)

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.DBCommand Editor,
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




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Allowing access to my own computers within my own network =?Utf-8?B?VHJldm9y?= Wireless Networking 2 07-20-2006 09:05 PM
I have built my own (simple) thread manager [TM], but just found java 5 has its own. Saverio M. Java 0 07-03-2006 08:52 AM
Your own photos in your own book Frank ess Digital Photography 1 12-09-2004 05:54 PM
Using own classloader inside J2EE to load and unload own classes. Stefan Siegl Java 0 09-21-2004 08:11 AM
Spam: Re: Own Your Own On-Line Travel Agency Howard NZ Computing 0 08-01-2003 07:46 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57