SQlite insert not working

Posted by Ondro Tadanai on Stack Overflow See other posts from Stack Overflow or by Ondro Tadanai
Published on 2012-06-10T16:36:04Z Indexed on 2012/06/10 16:39 UTC
Read the original article Hit count: 208

Filed under:
|

I'm writing a C# database winform app and I have a problem executing this query. It throws me this error:

SQLite error
near "SELECT": syntax error

Can someone help me please? Thanks for any answer or suggestion.

INSERT into subor(idsubor, idpodfk, pnazovfk, datumpravop, podiel, podield, cislozLV,
datumzaradenia, idmajetok)
values (null, " + comboBox1.SelectedValue.ToString() + ", 
         '" + comboBox2.SelectedValue.ToString() + "', 
         '" + dateTimePicker1.Value.ToString("d. M. yyyy") + "', 
         '" + textBox2.Text + "',
          " + podield.ToString("0.0000", System.Globalization.CultureInfo.InvariantCulture) + ", 
         '" + textBox4.Text + "', 
         '" + dateTimePicker2.Value.ToString("d. M. yyyy") + "', 
              SELECT IFNULL(a, '0') AS idmajetok 
              FROM (SELECT MAX(idmajetok) + 1 AS a FROM subor))";

© Stack Overflow or respective owner

Related posts about c#

Related posts about sqlite