Syntax error in INSERT INTO statement in c# oledb?
<p>I am having a table called SubMaster_Accounts, which contains 9 fields. In which I want to insert data to some fields and i want to store some other fields as NULL. I tried to write the query using query string, The sql query works perfectly when i insert the data for all the fields, but when i insert data as NULL to some of the fields it shows syntax error in Insert command. The fields which i want to insert as NULL are not constraints. </p>

<p>How can i do it?</p>

<p>This is my query string.</p>

<pre><code>insert into SubMaster_Account ([SMcode], [MSname], [Sname], [Openbalrs],
 [Openbalrs1], [Openbalmet], [Openbalmet1], [Creditdays], [Sdesc])
 values ('" + SMcode + "','" + MSname + "','" + Sname + "'," + 
Openbalrs + ",'" + Openbalrs1 + "'," + Openbalmet + ",'" + 
Openbalmet1 + "'," + Creditdays + ",'" + Sdesc + "')
</code></pre>
