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. runtime created tables into SQL databases

runtime created tables into SQL databases

Scheduled Pinned Locked Moved C#
databasesql-serversysadmin
4 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.
  • M Offline
    M Offline
    minnie mouse
    wrote on last edited by
    #1

    Could someone please suggest the least problematic way of storing tables that have been created and filled with data runtime, into a SQL server database. I am also looking to name the new tables in the database sequentially. Any suggestion would be appreciated. :confused:

    C 1 Reply Last reply
    0
    • M minnie mouse

      Could someone please suggest the least problematic way of storing tables that have been created and filled with data runtime, into a SQL server database. I am also looking to name the new tables in the database sequentially. Any suggestion would be appreciated. :confused:

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Create a table that stores the name of the tables (or just the last table). When you create a new table ensure you do the following in one trasaction * Get the name of the last table created and work out what the next table name should be * Create the table * Store the name of the new table in the table of table names.


      Scottish Developers events: * .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog

      M 1 Reply Last reply
      0
      • C Colin Angus Mackay

        Create a table that stores the name of the tables (or just the last table). When you create a new table ensure you do the following in one trasaction * Get the name of the last table created and work out what the next table name should be * Create the table * Store the name of the new table in the table of table names.


        Scottish Developers events: * .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog

        M Offline
        M Offline
        minnie mouse
        wrote on last edited by
        #3

        That sounds like a good way of arranging things, however as a beginner I am having problems managing items such as datasets and tables that are being created dynamically as the program runs and items that already exist as they have been created in the IDE, such as data sources, table adapters ETC. I am working on a data import program so the conventional approach of creating a database , data source, tables, table adaptors, and so on in the IDE doesnt work as there is no data to begin with. I currently have all my imported data in a datagrid , parsed correctly , just would like to know the best way of moving this to a blank SQL database. Thanks for all the help so far :confused:

        C 1 Reply Last reply
        0
        • M minnie mouse

          That sounds like a good way of arranging things, however as a beginner I am having problems managing items such as datasets and tables that are being created dynamically as the program runs and items that already exist as they have been created in the IDE, such as data sources, table adapters ETC. I am working on a data import program so the conventional approach of creating a database , data source, tables, table adaptors, and so on in the IDE doesnt work as there is no data to begin with. I currently have all my imported data in a datagrid , parsed correctly , just would like to know the best way of moving this to a blank SQL database. Thanks for all the help so far :confused:

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          minnie mouse wrote:

          so the conventional approach of creating a database , data source, tables, table adaptors, and so on in the IDE doesnt work as there is no data to begin with.

          Don't use the IDE, it is bad practice anyway. You should create a separate class for your data interaction (or multiple classes if you want to split the data interaction up into logical grouping - you can put the common stuff in a base class and have all your data access classes inherit from it). If you don't know how to write data access code already have a look at what the IDE is doing for you then copy and modify it for your own uses.


          Scottish Developers events: * .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog

          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