Why in the database is inserted into the same copy of the data?

Can't understand why the following code inserts into the database the same copy of the data.

Here so it looks.

The method takes an array of data from the PG. Then runs on it and each element inserts into SQLite. I even exit of elements added. Displays all different, but inserted hard the same. Here is my code:

public void InsertData(List<userdata> PGuds)
{
 Connection = new SQLiteConnection("Data Source=" + config.SQLLitePath + ";Version=3;");
Connection.Open();

 SQLiteCommand insertSQL = new SQLiteCommand(@"INSERT INTO "USERS" (id, guid, username, userblob) VALUES (?,?,?,?)", (SQLiteConnection)Connection);
try
{
Console.WriteLine(uds.Count);

Console.WriteLine("iiiiiiiiiiiiiiiiiiiiii");
 foreach (UserData d in PGuds)
{
Console.WriteLine("ooooooooooooo");
Console.WriteLine(d.Id);
Console.WriteLine(d.Guid);
Console.WriteLine(d.Name);
 insertSQL.Parameters.Add(new SQLiteParameter { Value = d.Id });
 insertSQL.Parameters.Add(new SQLiteParameter { Value = d.Guid });
 insertSQL.Parameters.Add(new SQLiteParameter { Value = d.Name });
 insertSQL.Parameters.Add(new SQLiteParameter { Value = d.UserBlob, DbType = DbType.Binary });

insertSQL.ExecuteNonQuery();
 Console.WriteLine("Data Inserted in SQLLite");
}

}

 catch (Exception e)
{
Console.WriteLine(e.StackTrace);
Console.WriteLine(e.Message);

}
 }</userdata>
July 9th 19 at 13:42
1 answer
July 9th 19 at 13:44
Solution
Not much of a topic, but most likely you need a string creating query ("SQLiteCommand insertSQL = new SQLiteCommand") is also put into the cycle. Most likely, the Add method will not work when all the data has already been added.
You were right) thank you) - paula.Ste commented on July 9th 19 at 13:47

Find more questions by tags C#Databases