How do I count the number of rows returned in my SQLite reader in C#?

前端 未结 11 2156
生来不讨喜
生来不讨喜 2021-01-11 13:10

I\'m working in Microsoft Visual C# 2008 Express and with SQLite.

I\'m querying my database with something like this:

SQLiteCommand cmd = new SQLiteC         


        
11条回答
  •  梦毁少年i
    2021-01-11 13:57

    You do have to count with select count... from...

    This will make your application slower. However there is an easy way to make your app faster and that way is using parameterized queries.

    See here: How do I get around the "'" problem in sqlite and c#?

    (So besides speed parameterized queries have 2 other advantages too.)

提交回复
热议问题