Sql Connection1
-
I am using sqlconnection control in vb.net and i use it for different form. Everytime if i move my database and my application to other Computer, I need to change the connection string one by one in each form and of course this is abit troublesome for me. Any ways to change the sqlconnection string in properties only 'once', and all sqlconnection string in all forms will also change?
-
I am using sqlconnection control in vb.net and i use it for different form. Everytime if i move my database and my application to other Computer, I need to change the connection string one by one in each form and of course this is abit troublesome for me. Any ways to change the sqlconnection string in properties only 'once', and all sqlconnection string in all forms will also change?
Hey Buddy you must use app.config file. If you do need an example i will provide you ok. Wait Bye... Muhammad Waqas Butt waqasb4alll@yahoo.com
-
Hey Buddy you must use app.config file. If you do need an example i will provide you ok. Wait Bye... Muhammad Waqas Butt waqasb4alll@yahoo.com
I would love to see the example. Sorry for double posting thread
-
I would love to see the example. Sorry for double posting thread
Here is Code Buddy... First add App.config file into your project. [1] Add below code in the App.config How to get the key value. code is: First add system.configration; reference is the file. then add this code on you button click. try { string consetting = ConfigurationSettings.AppSettings["constr"]; // Get the Key value from app.config. // I'm not good in VB.Net but still a try In VB.Net get key value could like this // String consetting As ConfigurationSettings.AppSettings["constr"] txtconstr.Text = consetting; } catch(Exception ex) { MessageBox.Show("Exception : " + ex.Message, "Muhammad Waqas Butt", MessageBoxButtons.OK, MessageBoxIcon.Information); } } See how simple is to do. Ok please inform me if any problem occure in this code ok Muhammad Waqas Butt:-> waqasb4all@yahoo.com