Get first record-set from output data table assign it to argument variable



Hello -

I have a separate xaml file where i pass the SQL Query as argument (sqlquery). I keep invoking this file whenever i want the query to run on the database.

for example, consider the below query

select loginId from TblEmployee where username=‘as12’

so the output will always have one record and i want that to be passed to the argument(sqlquery) which is defined as in/out

I want the first record of output table to be assigned to argument variable. How can i achieve this ?

for example if output table looks like below


then sqlquery = 23456


My understanding is that you first want to find out what he first login id is and then use it in your query?

If so you will need two separate SQL statements the first to obtain all the LoginIDs to a datatable. From there you can select datatable.Rows(“LoginID”)(0).ToString and use that in your subsequent SQL query.

Does that help?



Excellent. Thanks