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. Visual Basic
  4. Add new DataTable to a database???

Add new DataTable to a database???

Scheduled Pinned Locked Moved Visual Basic
databasequestion
6 Posts 4 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.
  • F Offline
    F Offline
    fiaolle
    wrote on last edited by
    #1

    Hi I wonder if I can make a table to an existing database without using the statement "Create Table". I want to use the Datatable with DataColumns and DataRows I have made. Is there a way I can connect to the database in code and add this DataTable? If so, please tell me Fia

    D R 2 Replies Last reply
    0
    • F fiaolle

      Hi I wonder if I can make a table to an existing database without using the statement "Create Table". I want to use the Datatable with DataColumns and DataRows I have made. Is there a way I can connect to the database in code and add this DataTable? If so, please tell me Fia

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      I don't believe you can do that. I think you have to create the table with SQL code first. Dave Kreskowiak Microsoft MVP - Visual Basic

      1 Reply Last reply
      0
      • F fiaolle

        Hi I wonder if I can make a table to an existing database without using the statement "Create Table". I want to use the Datatable with DataColumns and DataRows I have made. Is there a way I can connect to the database in code and add this DataTable? If so, please tell me Fia

        R Offline
        R Offline
        Ray Cassick
        wrote on last edited by
        #3

        As far as I know you can't do it that way. You have to create tables using the proper SQL syntax. From what I remember when talking to a SQL engineer @ MS even the SQL Enterprise manager just talks SQL to the DB engine when creating and deleting tables.


        My Blog[^]
        FFRF[^]


        D 1 Reply Last reply
        0
        • R Ray Cassick

          As far as I know you can't do it that way. You have to create tables using the proper SQL syntax. From what I remember when talking to a SQL engineer @ MS even the SQL Enterprise manager just talks SQL to the DB engine when creating and deleting tables.


          My Blog[^]
          FFRF[^]


          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          That's part of the SQL specification. The engine and system databases are managed by the same language used to manipulate user databases. Dave Kreskowiak Microsoft MVP - Visual Basic

          M 1 Reply Last reply
          0
          • D Dave Kreskowiak

            That's part of the SQL specification. The engine and system databases are managed by the same language used to manipulate user databases. Dave Kreskowiak Microsoft MVP - Visual Basic

            M Offline
            M Offline
            master napishi ru
            wrote on last edited by
            #5

            you can add reference to "Microsoft.SqlServer.Smo" and use it's classes to manage (create, alter, drop) any SQLServer objects - tables, procedures, constraints, indexes, foreign keys etc. Very useful.

            D 1 Reply Last reply
            0
            • M master napishi ru

              you can add reference to "Microsoft.SqlServer.Smo" and use it's classes to manage (create, alter, drop) any SQLServer objects - tables, procedures, constraints, indexes, foreign keys etc. Very useful.

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              That works if your using SQL Server 2005. Other versions, I recommend using the SQL method. In either case, he wanted to do it just by adding a new DataTabel object to his DataSet, which won.t work at all. Dave Kreskowiak Microsoft MVP - Visual Basic

              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