This is not best approach from performance standpoint but you could filter on SQL Server
side:
string query = "SELECT *
FROM OPENQUERY(linked_server, 'SELECT * FROM User.Table') s
WHERE col1 = @parameter1";
EDIT:
From How to pass a variable to a linked server query:
When you query a linked server, you frequently perform a pass-through query that uses the OPENQUERY, OPENROWSET, or OPENDATASOURCE statement.
This article provides three examples of how to pass a variable to a linked server query.
To pass a variable to one of the pass-through functions, you must build a dynamic query.
Approach 1:
Pass Basic Values
When the basic Transact-SQL statement is known, but you have to pass in one or more specific values, use code that is similar to the following sample:
DECLARE @TSQL varchar(8000), @VAR char(2)
SELECT @VAR = 'CA'
SELECT @TSQL = 'SELECT * FROM OPENQUERY(MyLinkedServer
,''SELECT * FROM pubs.dbo.authors WHERE state = '''''
+ @VAR + ''''''')'
EXEC (@TSQL)
Approach 2:
Use the Sp_executesql Stored Procedure
To avoid the multi-layered quotes, use code that is similar to the following sample:
DECLARE @VAR char(2)
SELECT @VAR = 'CA'
EXEC MyLinkedServer.master.dbo.sp_executesql
N'SELECT * FROM pubs.dbo.authors WHERE state = @state',
N'@state char(2)',
@VAR
and in your example:
DECLARE @parameter1 <your_type> = ?;
EXEC linked_server.master.dbo.sp_executesql
@'SELECT * FROM User.Table WHERE col1 = @parameter1 '
,N'@parameter1 <your_type>'
,@parameter1;
If you need to do some other operation on local side:
DECLARE @parameter1 <your_type> = ?;
CREATE #temp(col_name <type>, ...);
INSERT INTO #temp(col_name)
EXEC linked_server.master.dbo.sp_executesql
@'SELECT col_name1,... FROM User.Table WHERE col1 = @parameter1 '
,N'@parameter1 <your_type>'
,@parameter1;
SELECT *
FROM #temp
-- JOIN any local table (SQL Server's side)
-- WHERE any_condition;