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 / September 2007

Tip: Looking for answers? Try searching our database.

Connection string design-time editor

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ahmed Hashish - 23 Sep 2007 10:07 GMT
Dear Sir
I'd like to create a user control that has a connection string property that allows the user to setup a connection at design time in the same fashion as in Project settings or TableAdapters.

When a someone adds this control to their form, there will be a property called ConnectionString that when it is clicked (via the Properties grid), it will bring up the Connection Properties dialog box.

I tried the following code:
namespace UserControls

{

   public partial class UserControl1 : UserControl

   {

       public UserControl1()

       {

           InitializeComponent();

       }

       private string _connectionstring;

       [RefreshProperties(RefreshProperties.All),  RecommendedAsConfigurable(true), DefaultValue(""), Editor("Microsoft.VSDesigner.Data.SQL.Design.SqlConnectionStringEditor, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]

       public string Connectionstring

       {

           get { return _connectionstring; }

           set { _connectionstring = value; }

       }

   }

}

but the Editor used allow to build SQL connections only, Is there other Editors help building other databases connections.

Ahmed Hashish
Ahmed Hashish - 23 Sep 2007 10:54 GMT
I found IT

Editor("Microsoft.VSDesigner.Data.ADO.Design.OleDbConnectionStringEditor, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")

thanks

 Dear Sir
 I'd like to create a user control that has a connection string property that allows the user to setup a connection at design time in the same fashion as in Project settings or TableAdapters.

 When a someone adds this control to their form, there will be a property called ConnectionString that when it is clicked (via the Properties grid), it will bring up the Connection Properties dialog box.

 I tried the following code:
 namespace UserControls

 {

     public partial class UserControl1 : UserControl

     {

         public UserControl1()

         {

             InitializeComponent();

         }

         private string _connectionstring;

         [RefreshProperties(RefreshProperties.All),  RecommendedAsConfigurable(true), DefaultValue(""), Editor("Microsoft.VSDesigner.Data.SQL.Design.SqlConnectionStringEditor, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]

         public string Connectionstring

         {

             get { return _connectionstring; }

             set { _connectionstring = value; }

         }

     }

 }

 but the Editor used allow to build SQL connections only, Is there other Editors help building other databases connections.

 Ahmed Hashish

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.