Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Getting data from simple SQLite table returns NULL

Getting data from simple SQLite table returns NULL

Scheduled Pinned Locked Moved Database
databasecsharpmysqlsqlitequestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Uranium 235
    wrote on last edited by
    #1

    i'm used to MySQL, this is...different. A table with just one row Using "DB Browser for SQLLite"...structure CREATE TABLE "appinfo" ( "version" TEXT NOT NULL, "passworded" INTEGER NOT NULL, "username" TEXT NOT NULL ); I added a row. "1", 1, "Admin" with DB Browser when I query it "SELECT * FROM addinfo;" with DB browser I get NULL for each field (blank on my c# app) what am I missing here? thanks

    L 1 Reply Last reply
    0
    • U Uranium 235

      i'm used to MySQL, this is...different. A table with just one row Using "DB Browser for SQLLite"...structure CREATE TABLE "appinfo" ( "version" TEXT NOT NULL, "passworded" INTEGER NOT NULL, "username" TEXT NOT NULL ); I added a row. "1", 1, "Admin" with DB Browser when I query it "SELECT * FROM addinfo;" with DB browser I get NULL for each field (blank on my c# app) what am I missing here? thanks

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Uranium-235 wrote:

      what am I missing here?

      The correct spelling of "appinfo".

      U 1 Reply Last reply
      0
      • L Lost User

        Uranium-235 wrote:

        what am I missing here?

        The correct spelling of "appinfo".

        U Offline
        U Offline
        Uranium 235
        wrote on last edited by
        #3

        no, that wasn't a copy & paste, it was a misspelling here, when I actually do it from my c# app it returns the column names (found a function to easily present col names and row data, so the columns are correct), and one row of empty data, just like in DB Browser I just tried SELECT * FROM "main"."appinfo"; it returned , 0, the middle number is supposed to be a 1

        M L 2 Replies Last reply
        0
        • U Uranium 235

          no, that wasn't a copy & paste, it was a misspelling here, when I actually do it from my c# app it returns the column names (found a function to easily present col names and row data, so the columns are correct), and one row of empty data, just like in DB Browser I just tried SELECT * FROM "main"."appinfo"; it returned , 0, the middle number is supposed to be a 1

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          I'm having trouble parsing your query! I would presume that "Main" is your database and is included in your connection string. If so then your query string should be "Select * from appinfo" and it should return the 1 record you have inserted. If you want an empty datatable then "Select * from Appinfo where 1=1"

          Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP

          U 1 Reply Last reply
          0
          • M Mycroft Holmes

            I'm having trouble parsing your query! I would presume that "Main" is your database and is included in your connection string. If so then your query string should be "Select * from appinfo" and it should return the 1 record you have inserted. If you want an empty datatable then "Select * from Appinfo where 1=1"

            Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP

            U Offline
            U Offline
            Uranium 235
            wrote on last edited by
            #5

            no this is from DB Browser, not even the app

            U 1 Reply Last reply
            0
            • U Uranium 235

              no this is from DB Browser, not even the app

              U Offline
              U Offline
              Uranium 235
              wrote on last edited by
              #6

              Nevermind. I inserted it into the database with a query in DB Browser instead of using the browser and it seemed to work :shrug: thanks for putting up with me

              1 Reply Last reply
              0
              • U Uranium 235

                no, that wasn't a copy & paste, it was a misspelling here, when I actually do it from my c# app it returns the column names (found a function to easily present col names and row data, so the columns are correct), and one row of empty data, just like in DB Browser I just tried SELECT * FROM "main"."appinfo"; it returned , 0, the middle number is supposed to be a 1

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Whatever you think you entered perhaps did not happen. Or your query is somehow incorrect. You can easily get all the information from SQLite database files using the sqlite3 command line interface.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups