AS you are using SQL Server I would pass the information to a stored procedure and then using T-SQL I would do
1. Compare the usernames from the 2 databases i.e.
declare @UserName VARCHAR(50) = null
select @UserName = a.username
from tableName b inner join database2.dbo.TableName b
on a.username = b.username
2. If the name exists in database 2 then do the insert
if @UserName is not null
begin
insert into database2.dbo.tablename
select columnnames
from tablename
end
Further Reading
Create Stored Procedure[
^]
Calling Stored Procedure using ADO.NET[
^]
This article is in C# but it is very easy to convert