Web Test->DataSource Attribute ->Connection String from App.Config ?

Hi,

i have a connection string defined in my app.config and i want to use in the DataSource Attribute In my Web Test . i am getting an error that the connection string must be a constant.
i saw and followed a similar thread regarding this issue but nothing.

code sample:

<DataSource("DataSource1","Provider=OraOLEDB.Oracle.1;Data Source=GENERIC;PersistSecurityInfo=True;UserID=*****;Password=****", Microsoft.VisualStudio.QualityTools.WebTestFramework.DataBindingAccessMethod.Sequential,"SUBS_INFO"), _

DataBinding("DataSource1","MyTable","MyCol","DataSource1.MyTable.MyCol")> _

To
<DataSource("DataSource1",My.Setting.connectionString,....

thanks Udi

[1531 byte] By [UdiAms] at [2007-12-17]
# 1
Try creating a web test and using the UI to add the data source. Then generate code and use the generated code in your test.

I can't tell for sure due to wrapping, but it looks like you have an extra line feed after the "<DataSource..." line.

EdGlas at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 2
Would anyone be kind enough to post an example (C#) of how this would work using a webtest in RC1. In another post (http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=12956) it seems to suggest using a DataSourceAttribute ctor that isn't available to me.

Thanks

Mountain

Mountain at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...

Visual Studio Team System

Site Classified