mardi 11 août 2015

C# and SQLite. Only does 60% of inserts

I have the fellow method:

     internal void ExecuteBatchSqlNoParameters(List<string> updateSqlList)
    {
        var connection = GetSqLiteConnection(DatabaseFilepath);

        connection.Open();

        using (DbCommand command = connection.CreateCommand())
        using (DbTransaction transaction = connection.BeginTransaction())
        {
            foreach (var updateSqlText in updateSqlList)
            {
                command.CommandText = updateSqlText;
                command.ExecuteNonQuery();
            }

            transaction.Commit();
        }

        connection.Close();
        connection.Dispose();
    }

This method works when the string list is under 1,000 strings but when it is over 1,000 it only imports ~60% of the strings. But I do not understand why.

Aucun commentaire:

Enregistrer un commentaire