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. Initialization in web services

Initialization in web services

Scheduled Pinned Locked Moved C#
questiondatabasewcflearning
3 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.
  • P Offline
    P Offline
    pelos
    wrote on last edited by
    #1

    hello, My Web Service accesses to a MS SQL database to store and retrieve data from it. but to store data, first I must to create programatacally the database and the tables. My question is what is the best way to do this? where is the best place to put the code which do this? In the beginning of each Web method (if the database and the tables do not exist, of course) or there is a common place to create or to initialize data, structures, systems, connections, etc.? thanks in advance.

    D N 2 Replies Last reply
    0
    • P pelos

      hello, My Web Service accesses to a MS SQL database to store and retrieve data from it. but to store data, first I must to create programatacally the database and the tables. My question is what is the best way to do this? where is the best place to put the code which do this? In the beginning of each Web method (if the database and the tables do not exist, of course) or there is a common place to create or to initialize data, structures, systems, connections, etc.? thanks in advance.

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

      Actually, the best way to do it is to run the SQL script that creates everything either ahead of time, or when the Web Service is installed. Checking for the existance of the database on every call is very unecessary and just wastes time and resources doing the checks for something will only be done once. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      1 Reply Last reply
      0
      • P pelos

        hello, My Web Service accesses to a MS SQL database to store and retrieve data from it. but to store data, first I must to create programatacally the database and the tables. My question is what is the best way to do this? where is the best place to put the code which do this? In the beginning of each Web method (if the database and the tables do not exist, of course) or there is a common place to create or to initialize data, structures, systems, connections, etc.? thanks in advance.

        N Offline
        N Offline
        Nick Parker
        wrote on last edited by
        #3

        pelos wrote: first I must to create programatacally the database and the tables. My question is what is the best way to do this? Don't forget to add data. Aside from what Dave said I think you may be confusing two aspects of the software development lifecycle. You can manually type the DDL to create your database, tables and insert data into or you can use the visual tools that popular RDBMS provide. The purpose of web services is to allow a tranparent transport protocol regardless of operating system for data flow. Does that make sense? - Nick Parker
        My Blog | My Articles

        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