This is in your C# code. So what you could do would be something like -
var db=new LINQDataContext();
grid.datasource=db.table.where(c=>c.field1==""" + str2 + """ && c.field2==""" + str2 + """;)
where
str1
and
str2
would be variables that would act like your parameters.