Page 1 of 1

Assign global connection string

Posted: Thu 03 Feb 2011 10:17
by Thomas J.
Hello all,
I do my first steps in ASP.NET.
I have a WebForm in VS2010 with a MySqlDataSource and the connection string I assign in the Page_Load method. But this I have to do for every page. This is not fine.

In C++Builder Desktop application I have a Connection component and this I assign to the several datasources once via designer and not every time via source.

Is this also possible in ASP.NET with your component.

Right now my code is below

Code: Select all

        protected void Page_Load(object sender, EventArgs e)
        {
            // ConfigurationSettings.AppSettings("CratemakerDB");
            NameValueCollection names = ConfigurationManager.AppSettings;
            String value = names.Get("CratemakerDB");
            MyDsFirma.ConnectionString = value;
        }
Thanks
Thomas

Posted: Fri 04 Feb 2011 14:07
by Shalex
As I understood, you are talking about the capabilities of InterForm Technology: http://www.devart.com/dotconnect/mysql/ ... rForm.html. This feature is available only in the WinForms projects.