XML Query with a variable in WHERE
<p>I have this code that works well. But I want to have a variable to change its value in run time. I want the output xml file in C#.</p>

<pre><code>declare @MySearch nvarchar(50)
set @MySearch='بودان'

SELECT ID, Family
FROM Table_1
where freetext(Family, @MySearch, LANGUAGE 1025)
FOR XML RAW ('Employee'), ROOT ('Employees'), ELEMENTS XSINIL;
</code></pre>

<p>EDITED:</p>

<p>I ran this code and got this error: </p>

<blockquote>
  <p>Null or empty full-text predicate.</p>
</blockquote>

<p>I want the output <code>xml</code> file in <code>C#</code>.</p>

<pre><code>declare @MySearch nvarchar(50)
--set @MySearch=N'بودان'    
SELECT ID, Family
FROM Table_1
where freetext(Family, @MySearch, LANGUAGE 1025)
FOR XML RAW ('Employee'), ROOT ('Employees'), ELEMENTS XSINIL;
</code></pre>