Using/reading SqlDataConnector

Ask general questions here.
SanMan
Posts: 210
Joined: Tue Apr 13, 2010 9:59 am

Using/reading SqlDataConnector

Post by SanMan » Tue May 28, 2019 1:32 pm

Hi,

I have created an SqlDataConnector.

Can I use/access it from user code somehow?

I do not want to use it like "Data source" added to testcase.

Just want to read the data from some points while running the test.

Can I read the data with user code somehow?

SanMan
Posts: 210
Joined: Tue Apr 13, 2010 9:59 am

Re: Using/reading SqlDataConnector

Post by SanMan » Wed May 29, 2019 5:36 am

https://www.ranorex.com/forum/how-to-do ... t8914.html

This is something I am looking for.

Is there somewhere in user guide or code example how to create this connection?

Can I use/utilize the data source I have already created?

"Once added to a test suite, the data source can be assigned to the test containers of this test suite."
=> With user code, I do not need to assign it and still read the data?

SanMan
Posts: 210
Joined: Tue Apr 13, 2010 9:59 am

Re: Using/reading SqlDataConnector

Post by SanMan » Fri May 31, 2019 7:55 am

It was easy:

var dataConn = DataSources.Get("<connection_name>");
string one_name = dataConn.Rows[1].Values[2];

And I do not need to bind <connection_name> to test suite to use it. :)