I am using VS2005 C# and SQL Server 2005.
I have a SQL Query which I will execute, and I wish to store the results that I will be getting from the query.
The following is my SQL query:
SELECT DISTINCT EmployeeID FROM UserRoles WHERE ([Status] = 'DELETED')
This returned me a list of employee IDs whose status are 'DELETED'. I am able to view it via GridView and it is displaying perfectly.
But what I want is to use this result (list of emp ID whose status='DELETED'), and run through another table to see if the same emp ID exist in the other table, if yes, store it in another DB or list.
I am not really sure how do I store the result from my select statement, which is the list of emp IDs whose status='DELETED' into a string or array. After i manage to store it, how do i get one emp ID at a time and run through the other table?
I need some help from experienced.