Get data from related custom tables in custom table data list

Lokendra Jain asked on September 12, 2018 10:59

Hi All,

We have a custom table "CustomTable_Employee" and we have another table "Employee_Location".

In "CustomTable_Employee" we are storing "Employee_Location" table's itemid as EmployeeLocationId.

When we are binding datalist for "CustomTable_Employee", how to get the EmployeeLocationName column value instead of EmployeeLocationId column value?

Is there option available in cms to do this?



Recent Answers

Arun Kumar answered on September 12, 2018 11:51

If you are using Repeater control then go to your repeater properties -> Edit Query and write simple SQL Query to join both tables (something like below)

SELECT emp.ItemID, emp.Name, loc.Name
FROM CustomTable_Employee emp
JOIN Employee_Location loc
ON emp.EmployeeLocationId = loc.ItemID

and then You can add returned columns in Selected columns properties of repeater.

0 votesVote for this answer Mark as a Correct answer

Lokendra Jain answered on September 12, 2018 14:53

Hi Arun,

I am not using repeater control. I am using the custom table data list control.



0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.