onmyway365 .

onmyway365 .

  • NA
  • 39
  • 5k

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

Jan 18 2016 6:19 AM
Hi All,
 
I hope you can help me. 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: 
  
private static void customerCode()
{
   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
}
      }
}
 
Thank you in advance! 

Answers (6)