Results 1 to 6 of 6

Thread: application deployment problem

  1. #1
    Adama's Avatar Xtreme User BT Rep: +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100
    Join Date
    Oct 2007
    Posts
    1,377
    hi all
    i am using VS 2005
    i want my application when installed to make sure that my database is instaled on sqlserver if not than my application should create the datbase itself
    my friend told me to write the code that create the datbase and the tables
    ( CREATE DATABASE var1 .........) in the class install
    but i have more than 8 tables and that will be a long code to affect it to the SqlCommand
    so is there any other way to make my application create the database when installed

    hope someone help or tell me some forums which could help me

    regards ,
    warid



  2. Internet, Programming and Graphics   -   #2
    4play's Avatar knob jockey
    Join Date
    Jan 2003
    Location
    London
    Age
    41
    Posts
    3,824
    you can just write the database creation code once in a txt file and run it on install. I would also recommend the 'create if not exist' option so you dont overwrite existing tables.

    im more used to mysql so im not sure how to do it in mssql sorry

  3. Internet, Programming and Graphics   -   #3
    Adama's Avatar Xtreme User BT Rep: +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100BT Rep +100
    Join Date
    Oct 2007
    Posts
    1,377
    thanks it works i added the txt file to my application and execute the code from the txt file
    http://msdn2.microsoft.com/en-us/lib...tk(VS.80).aspx



  4. Internet, Programming and Graphics   -   #4
    Snee's Avatar Error xɐʇuʎs BT Rep: +1
    Join Date
    Sep 2003
    Location
    on something.
    Age
    44
    Posts
    17,985
    Quote Originally Posted by 4play View Post
    you can just write the database creation code once in a txt file and run it on install. I would also recommend the 'create if not exist' option so you dont overwrite existing tables.

    im more used to mysql so im not sure how to do it in mssql sorry
    This is just an aside, at this point, but basic stuff like CREATE should be exactly the same.

    It's when you come to stuff like LIMIT/TOP and RAND() and foreign keys things may be a bit different, not to mention stored procedures and all of that jazz.

  5. Internet, Programming and Graphics   -   #5
    lightshow's Avatar Asleep at the wheel
    Join Date
    Mar 2003
    Age
    38
    Posts
    902
    Yeah, but make sure that the user running the application has the right rights to be able to execute sql commands on SQL Server or whichever one you're using.


    That's a big problem for my team since they won't give us all the rights we need.


    But in your case, at least it is easy to use the "script to" command in the database server and copy the raw sql needed to make a table that already exists, then repeat for all tables.
    I miss the days of random nut '03
    Click for more activation options, then activate by telephone. Run the keygen.
    if I call them, aren't they going to get me? (you know, down there)

  6. Internet, Programming and Graphics   -   #6
    wadir botn

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •