sqlconnection string defined in config

Ranorex Studio, Spy, Recorder, and Driver.
omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

sqlconnection string defined in config

Post by omayer » Fri Apr 20, 2012 9:24 pm

in user code module -- how will i defined the sqlconnection in globally so i don't have to defined in each class

SqlConnection myConnection = new SqlConnection
("Data Source=(local)\\SQLExpress;Initial Catalog=xxxyyy;Integrated Security=SSPI");

Thank you in Advance.
Beginner
Tipu

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: sqlconnection string defined in config

Post by Support Team » Mon Apr 23, 2012 8:02 am

Hi,

you can define a global parameter which can be bound to variables generated in your user code modules.
Following chapter of our user guide will explain how to add variables to your user code modules:
Using Variables with Code Modules
And the following chapter of our user guide will explain how to bind global parameters to variables:
Combining Variables with Parameters

Regards,
Tobias
Ranorex Team

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: sqlconnection string defined in config

Post by omayer » Tue Jun 05, 2012 5:07 pm

Ok , how will i add the connection to App.config file then call the connection from any class
Tipu

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: sqlconnection string defined in config

Post by Support Team » Wed Jun 06, 2012 10:09 am

Hi,

I did not mean the app.config, but the global variables in your test suite project as described in the chapters mentioned in my last post.

Regards,
Tobias
Ranorex Team