Discussion:
Connection string design-time editor
(too old to reply)
Ahmed Hashish
2007-09-23 09:07:02 UTC
Permalink
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
2007-09-23 09:54:09 UTC
Permalink
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

"Ahmed Hashish" <***@hotmail.com> wrote in message news:%23OhqTEc$***@TK2MSFTNGP03.phx.gbl...
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

Loading...