Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / May 2005

Tip: Looking for answers? Try searching our database.

Generate Query Builder Programitically

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
anandjain5@gmail.com - 04 May 2005 10:17 GMT
hi all

I want to create my own OledbCommand control.Since OledbCommand class
is sealed class.
I can't inherit control from that.I inherit control from usercontrol
and take an object of oledbcommand control
and expose required properties.So for the commandtext property,I want
to open query builder for the control.

So how to open query builder programitically.

regards
Jaini
joeycalisay - 04 May 2005 10:24 GMT
you can try attaching the editor attribute like the oledbcommand object's
commandtext property, note, it is under a VSDesigner assembly...

[Editor("Microsoft.VSDesigner.Data.ADO.Design.OleDbCommandTextEditor,
Microsoft.VSDesigner, Version=7.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor)),
RefreshProperties(RefreshProperties.All), DataCategory("DataCategory_Data"),
DefaultValue(""), DataSysDescription("DbCommand_CommandText")]
public string CommandText
{
     get
     {
           if (this.cmdText == null)
           {
                 return string.Empty;
           }
           return this.cmdText;
     }
     set
     {
           if (ADP.SrcCompare(this.cmdText, value) != 0)
           {
                 this.OnSchemaChanging();
                 this.cmdText = value;
           }
     }
}

Signature

Joey Calisay
http://spaces.msn.com/members/joeycalisay/

> hi all
>
[quoted text clipped - 9 lines]
> regards
> Jaini
anandjain5@gmail.com - 04 May 2005 13:53 GMT
Hi Joeycalisay

Thanks for reply.
But I am  getting  'System.Data.DataCategoryAttribute' is inaccessible
due to its protection level and I don't understand  what is
ADP.SrcCompare?
and this.OnSchemaChanging() method?

regards
Jaini
joeycalisay - 05 May 2005 01:15 GMT
Sorry about that, I just pasted the whole property with the attribute from
Reflector.  Just add the same Editor attribute to see if it will work
(probably not, perhaps the components are tightly coupled).  If it is not
possible, just use Reflector so you have an idea how to implement your
own...

Signature

Joey Calisay
http://spaces.msn.com/members/joeycalisay/

> Hi Joeycalisay
>
[quoted text clipped - 6 lines]
> regards
> Jaini
anandjain5@gmail.com - 09 May 2005 08:26 GMT
Hi Joeycalisay

Thanks for reply.

It works,when I hosted my control on VisualStudio.net, but when I
hosted on my own designer this property comes as simple string property

regards
Jaini

> Sorry about that, I just pasted the whole property with the attribute from
> Reflector.  Just add the same Editor attribute to see if it will work
> (probably not, perhaps the components are tightly coupled).  If it is not
> possible, just use Reflector so you have an idea how to implement your
> own...
joeycalisay - 09 May 2005 11:37 GMT
It was expected since the assembly which contains the said class is the one
used by VS....

Signature

Joey Calisay
http://spaces.msn.com/members/joeycalisay/

> Hi Joeycalisay
>
[quoted text clipped - 14 lines]
> your
> > own...
anandjain5@gmail.com - 10 May 2005 09:49 GMT
So How to use control in my own Designer?
Can I get Query Builder tool somewhere else?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.