C# SQLite error Insufficient parameters supplied to the command -


I get an error in the SQLite error command given enough parameters given during running an inclusion statement in my program Are there. However, I've got it compressed down only if I will try to insert data into two different tables in succession. Which means that I incorporate the data into one and all the items are deposited in this method, because I am using the statement of use.

If I insert data into a table stop debugging, then reconstruct my solution and then insert it into another table, then this error will not arise.

Anyone have any ideas? Like I said that everything is explained in the use of statements, so I do not know what is happening in memory.

Here's my method:

  Public static zero SQLiteTableINSERT (string (SQLiteConnection Conn = new SQLiteConnection (SQLiteConn.Conn)) {(SQLiteTransaction sqliteTrans = Conn.BeginTransaction () ) Using {SQLiteCommand CMD = Conn.CreateCommand ()) {cmd.CommandText = PrepareInsert (tableName); (INTI = 0; I and LT; localDetetSet.LocalDiTTables [0] .Rov.Count; ++I) {foreach (local column column in Local Dataset. Local DSTB [0]. Column) {string temp = LocalDataSet Localards Tables [0]. Roho [ii] [cola, datarvversen Current]. Ostring (); Cmd.Parameters.AddWithValue ("@" + col.ColumnName, temp); } Cmd.ExecuteNonQuery (); }} SqliteTrans.Commit (); }} SQLite.SQLiteConn.Conn.Close (); }  

Any ideas would be great thanks.

I think you need to use the table name in the loop, assuming that the tables T has only one schema.

The command is ready for the table with the name of the table, but the parameters you are adding are always from tables [0], Tables [tableName]

> < / Html>

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -