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. How to create an exist database [modified]

How to create an exist database [modified]

Scheduled Pinned Locked Moved Database
databasesqlitesysadmintutorialannouncement
1 Posts 1 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.
  • Y Offline
    Y Offline
    yueru
    wrote on last edited by
    #1

    If I has database but in sqlite command can't write into exists dataase

    sql_con = new SQLiteConnection("Data Source=database.db;Version=3;New=True;Compress=True;");

    how to command that write whatever database is exist !!! I 've already use command but it's not work

    if (File.Exists("" + info + ".db"))
    {
    sql_con = new SQLiteConnection("Data Source= " + info + ".db;Version=3;New=False;Compress=True;");
    sql_con.Open();
    sql_cmd = sql_con.CreateCommand();
    sql_cmd.CommandText = "drop table par ;";
    sql_cmd.ExecuteNonQuery();
    }
    else
    {
    sql_con = new SQLiteConnection("Data Source= " + info + ".db;Version=3;New=True;Compress=True;");

            }
    
           //  FileStream fileStream = new FileStream(@" " + info + ".db", FileMode.Create);
           
                
            sql\_con.Open();
            sql\_cmd = sql\_con.CreateCommand();
            sql\_cmd.CommandText = "create table par (Date nvarchar(20), Time nvarchar(10), Linein NVARCHAR(20), Lineout NVARCHAR(20), Number NVARCHAR(20), Status nvarchar(10),Duration int(20), Cost nvarchar(20), Detail nvarchar(10), Network nvarchar(10));";
            sql\_cmd.ExecuteNonQuery();
    

    modified on Thursday, May 14, 2009 11:03 PM

    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