1.) do not reuse a parameter
2 .)
Values (@ STR, @ new) parametername = "@ Str." parametername = "@ new ."
As
The error indicates, you are using the parameters @ STR and @ new and
Adding two different parameters. Read the error message, it is there
For a reason and told you exactly what is wrong! 3.) Here is how I wocould write it (in this context ). using (sqliteconnection CNN = new sqliteconnection ("Data Source = C: // Eek. DB ")
using (sqlitecommand cmd = database. createcommand ()
{< br> cmd. commandtext = "insert into test (field1, fname) values (@ STR, @ new)";
cmd. parameters. addwithvalue ("@ Str", textbox1.text);
cmd. parameters. addwithvalue ("@ new", textbox2.text);
CNN. open ();
cmd. executenonquery ();
CNN. close ();
}< span style = "font-size: medium; "> while you can use dbconnection and dbcommand and make a factory
pattern sort of implementation (which I doubt is going here ...) I
suggest you do not. use the sqliteconnection, sqlitecommand, etc. the
provider specific objects generally have features that make coding
easier. in this case, the addwithvalue method.