Parameterized Update Statement in C# - Storing RTF in database
<p>I want to store some RTF-code as plain text in my .dbf fox-pro database, but I'm getting a "Syntax error" at the ExecuteNonQuery and I can't find the problem.</p>

<p>My code:</p>

<pre><code>String query1 = "UPDATE tb_benu SET be_sign = @signatur WHERE be_name = @sys_benutzer";
using (OleDbConnection dbfcon = new OleDbConnection("Provider=VFPOLEDB;Data Source=" + dataFolder))
{
     OleDbCommand cmd = new OleDbCommand(query1, dbfcon);
     cmd.Parameters.AddWithValue("@signatur", signatur);
     cmd.Parameters.AddWithValue("@sys_benutzer", sys_benutzer);

     dbfcon.Open();
     cmd.ExecuteNonQuery();
     dbfcon.Close();
 }
</code></pre>

<p>Why is it throwing a Syntax error? (even if I test it with normal text and not rtf)</p>

<p>If I use a simple sql query like this:</p>

<pre><code>string query1 = "UPDATE tb_benu SET be_sign='" + signatur + "' WHERE be_name='" + sys_benutzer + "';";
OleDbCommand cmd = new OleDbCommand(query1, conn);
cmd.ExecuteNonQuery();
</code></pre>

<p>it works for the text content of my RichTextBox, but not for the RTF-code.</p>