Posted 17 August 2020, 1:53 pm EST
We are using the Entity Framework, a c1DataSource with a ViewSource in Managed Virtual Mode, and a c1FlexGrid.
We have a textbox that we use to filter the ClientView from the ViewSource.
We use the .AsFiltered() method to filter the ClientView.
This all works well.
Virtual Mode works, and the filtering works.
Basically, we are filtering a database table named Customers.
I would like to know how to tackle the following task, with using the above configuration.
We would like to perform an inner select, but we want to pass through a variable from code.
For example,
(SELECT TOP 1 ClientContact.Description FROM ClientContact WHERE ClientContact.ContactID = @ContactID) AS Relationship
Where @ContactID is a variable we want to programmatically pass through.
For example, if I was using SQL and C# I would do something along the lines of
int contactId = 3;
string sqlQuery = “SELECT CustomerId, CustomerName, (SELECT TOP 1 ClientContact.Description FROM ClientContact WHERE ClientContact.ContactID = “ + contactId.ToString() + “) AS Relationship FROM Customers”;
Is this possible to achieve with the ClientView etc… as detailed above?