What you wanna do is make a Stored Procedure that does this and then call it from C#
Make the following stored procedure:
Create PROCEDURE [dbo].[LinkMyServer]
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
EXEC sp_addlinkedserver @server = N'LinkName',
@srvproduct = N' ',
@provider = N'SQLOLEDB',
@datasrc = N'some.domain.or.ip.com',
@catalog = N'database_name'
EXEC sp_addlinkedsrvlogin N'LinkName', false, N'ServerDomain\Administrator', N'user_on_remotedb', N'password_on_remote_db'
END
Now the remote db has been linked to the Local User Administrator.
Now in C# you just make a SqlCommand and and set type to stored procedure and execute a non query :)
ServerDomain\Administrator could also just be a sql user like 'dbo'.
Hope this helped.