Still valid - SimpleDataConnector(string, string[],string[][]) ??

Class library usage, coding and language questions.
qa-auto
Posts: 86
Joined: Mon Aug 05, 2019 10:46 pm

Still valid - SimpleDataConnector(string, string[],string[][]) ??

Post by qa-auto » Thu May 06, 2021 7:33 pm

Hi,

Is this constructor still supported in 9.4.1?

SimpleDataConnector(string, string[],string[][])

I'm getting the following exceptions for the last two params:
Screenshot 2021-05-06 133308.png
NOTE: This constructor is in the API documentation which doesn't indicate that's its for internal use.
ss34.png
Thanks for the help!
You do not have the required permissions to view the files attached to this post.
Last edited by qa-auto on Thu May 06, 2021 7:46 pm, edited 2 times in total.

qa-auto
Posts: 86
Joined: Mon Aug 05, 2019 10:46 pm

Re: Still valid - SimpleDataConnector(string, string[],string[][]) ??

Post by qa-auto » Thu May 06, 2021 7:38 pm

And for Ranorex Support, this is a work around to this post I made recently:

viewtopic.php?f=16&t=17936&p=65945#p65945

Cannot use this sqlCmd in the UI sql data connector definition because of the error I posted in the above URL.

Code: Select all

SELECT distinct pp.hdr_id,th.status_id 
FROM trans_hdr th 
INNER JOIN vw_loan_data ld ON th.id=ld.hdr_id 
LEFT JOIN trans_pmt_plan pp ON th.id =pp.hdr_id 
WHERE (pp.hdr_id IS NOT NULL and loan_model_id in (459) and store_id = 171) 
group by th.status_id 
having th.status_id in (1,2,3
order by th.status_id;
?

Jacob
Certified Professional
Certified Professional
Posts: 120
Joined: Mon Mar 22, 2021 10:01 pm

Re: Still valid - SimpleDataConnector(string, string[],string[][]) ??

Post by Jacob » Thu May 06, 2021 9:48 pm

qa-auto wrote:
Thu May 06, 2021 7:33 pm
Hi,

Is this constructor still supported in 9.4.1?

SimpleDataConnector(string, string[],string[][])
Thanks for the help!
Hi qa-auto!

My name is Jacob and I'm one of the engineers here at Ranorex. I really appreciate your screenshots, it helps! The documentation you pointed to is still correct, but I would suggest a change to your syntax for the "rows" array. The overload of the SimpleDataConnector method in question here is expecting a string, an array or strings, and a multi-dimensional array of strings (respectively). To create something like that, I would suggest code like the example below:

Code: Select all

string simpleConnName = "simpleName";
string[] cols= {"hdr_id", "status_id"};
string[] rowIndex= {"1", "2", "3"};
string[][] rows = {rowIndex, cols};
SimpleDataConnector simpleConnector = new SimpleDataConnector(simpleConnName, cols, rows);
I typed the above code straight into the post, so please use it as a guide and please don't rely on copying and pasting it into your project as there could be a syntax error or a misspelling.

I'm not a C# expert (so others may have other, better suggestions), but I've used it for a few years the above code works for me in other applications.

I hope this helps!
--Jacob
Image