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. General Programming
  3. C#
  4. SQLLite c# Wrapper

SQLLite c# Wrapper

Scheduled Pinned Locked Moved C#
csharpdatabasehelptutorialquestion
6 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.
  • A Offline
    A Offline
    aruna_koride
    wrote on last edited by
    #1

    Hi I am developing Windows Mobile Application using c#, SQLLite DataBase,I am using .NETWrapper for SQLLite, Iam able to Create Tables, but I wanted to create only once,How to check whether the Table is already created? I didnt find any samples in Website. Please help me Thanks

    R S 2 Replies Last reply
    0
    • A aruna_koride

      Hi I am developing Windows Mobile Application using c#, SQLLite DataBase,I am using .NETWrapper for SQLLite, Iam able to Create Tables, but I wanted to create only once,How to check whether the Table is already created? I didnt find any samples in Website. Please help me Thanks

      R Offline
      R Offline
      Rob Graham
      wrote on last edited by
      #2

      Try "Select Count(*) from Mytable" If you get an exception (or no such table error) then create it, if it succeeds, then move on to the next table.

      A 1 Reply Last reply
      0
      • R Rob Graham

        Try "Select Count(*) from Mytable" If you get an exception (or no such table error) then create it, if it succeeds, then move on to the next table.

        A Offline
        A Offline
        aruna_koride
        wrote on last edited by
        #3

        Thanks for your prompt reply, I will try it out.

        1 Reply Last reply
        0
        • A aruna_koride

          Hi I am developing Windows Mobile Application using c#, SQLLite DataBase,I am using .NETWrapper for SQLLite, Iam able to Create Tables, but I wanted to create only once,How to check whether the Table is already created? I didnt find any samples in Website. Please help me Thanks

          S Offline
          S Offline
          Sk8tzz
          wrote on last edited by
          #4

          Use Transact SQL.. Something like. IF 'USERS' NOT EXIST THEN CREATE TABLE ( ... ) Hopes his helps...

          .NET Rules

          A 1 Reply Last reply
          0
          • S Sk8tzz

            Use Transact SQL.. Something like. IF 'USERS' NOT EXIST THEN CREATE TABLE ( ... ) Hopes his helps...

            .NET Rules

            A Offline
            A Offline
            aruna_koride
            wrote on last edited by
            #5

            'USERS' means what?

            S 1 Reply Last reply
            0
            • A aruna_koride

              'USERS' means what?

              S Offline
              S Offline
              Sk8tzz
              wrote on last edited by
              #6

              Sorry.. typo mistake 'USERS' is the table.. Also if you are using an ms sql db, then you can also do something like this IF EXISTS (SELECT 1 FROM sysobjects WHERE xtype='u' AND name='tablename') --- 'tablename exists.' ELSE --- 'tablename does not exist.' Dropping Table DROP TABLE SALARY IF EXIST then create it again CREATE TABLE SALARY ( ... ) There are many ways to solve what you are trying to do..

              .NET Rules

              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