Check if value of Table A Column A in Table B Column B

onmyway

Member
Joined
Jan 18, 2016
Messages
12
Programming Experience
Beginner
Hi All,


I hope you can help me.

I am creating a Windows Service that validates and copies data.

I need help on a method to check whether the value from column A in table A, exists in column B in table B.

I am not sure how to approach this. I believe I need to loop through column B, checking it against the value of column A.

This is what I have so far:

C#:
[COLOR=#333333]private static void customerCode()[/COLOR][/FONT][/SIZE][INDENT][SIZE=2][FONT=arial]{
   using (var stageContext = new StagingTableDataContext())
{
   var data = stageContext.ProjectMasters;
   var referenceData = stageContext.CustomerMasters;
   
foreach (var entry in data)
{
//pseudo code
//check if entry.Customer_Number in referenceData.Customer_Code column

}
[/FONT][/SIZE][/INDENT]
[SIZE=2][FONT=arial][COLOR=#333333]    }[/COLOR]
[COLOR=#333333]}
[/COLOR][/FONT][/SIZE]


I appreciate all help!
 
Back
Top Bottom