praeclarum / praeclarum/sqlite-net

Sqlite-net newbie, always Index was out of range ?

Open
#786 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Need Info
Dominant language
C#
Stars
4.5k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

hi, Im new using sqllite-net, always got error Index was out of range, something is not clean ?

here my example:

            string dbPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "TestDB");
            SQLiteConnection dbTest = new SQLiteConnection(dbPath);
            dbTest.CreateTable<TestTable>();

            dbTest.Insert(new TestTable() { TestField = @"ABC\123", }); //<--**ALWAYS ERROR HERE ON SECOND RUN**

Step :

  1. Run F5 for firstime is ok
  2. Close the apps
  3. Run F5 Second time got error :

Unhandled Exception:

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Any help will be appreciated
TIA
Sen

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported sequence using SQLiteConnection, CreateTable(), and the second-run Insert call. Start by tracing that Insert path and capture the complete exception context; done means the cause of the second-run IndexOutOfRangeException is identified and a verified resolution is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, sqlite
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.