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. Creating a new database...

Creating a new database...

Scheduled Pinned Locked Moved Database
csharpdatabasetutorialquestionannouncement
2 Posts 2 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
    Amirjalaly
    wrote on last edited by
    #1

    Hi How we can create a new database for example access database that does not exist before by ADO.NET? the code must create files that needed for database (in this example .mdb file) and I want to know how create a new table in database and update database. Regards' Amir Jalaly

    R 1 Reply Last reply
    0
    • A Amirjalaly

      Hi How we can create a new database for example access database that does not exist before by ADO.NET? the code must create files that needed for database (in this example .mdb file) and I want to know how create a new table in database and update database. Regards' Amir Jalaly

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

      The easiest way for Access is to simply copy an empty access database (or a "template" with your data structures but no data) using filecopy. ADO.Net doesn't support "create Database" for Acess (actually it is the underlying oledb provider that doesnt support this), and the ADOX "create catolog" stuff isn't there either. To create a new tqable, juse use and execute query (OledbCommand.Execute or OledbConnection.Execute) like "Create Table TableName (Field1 Int Null, field2 Varchar(255), field3 Double)" If you need spaces (or keywords) in table/field names, then enclose them in sqare brackets [Field and Space] int,... Genius may have its limitations, but stupidity is not thus handicapped. - Elbert Hubbard

      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