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. Help on dymanic installation

Help on dymanic installation

Scheduled Pinned Locked Moved Visual Basic
questioncsharpdatabasesysadmin
3 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.
  • H Offline
    H Offline
    highjo
    wrote on last edited by
    #1

    hello guys! I know this question might sound a litle stupid but this my first application and things are still confused for me.I'm developing a data centric application in VB.NET with Visual Studio 2005 that is supposed to connect to sql server installed on the machine or in the network. For exemple in my application project i use the data adapter to connect to the database X with my settings (i mean my user name and password of the sql server on my machine or integrated security) in the connection string on every windowsforms. Then i wanted a way to deploy my application that will create my database during the installation.I liked one of the msdn ways that use the installer class to read an sql file.But i was more interrested by the method used by Mukund PUJARI in his article "create a database during installation version 2".My anxiety is this:if the end user has the freedom to choose the database Y and his location, then my application will definitively not be connected to the database end since my connectionstring is different connection to a database X. In my point of there should be a method that can put in the connectionstring the data provided by the end user.I don't have any idea.Even though i knew and then using data adapters and datasets stuffs how can i make them use it?Supposing i kew it too,it would be then after deployement that i can test that my application is using the database name that i provided during installation. All this are confusing me and if somebody can just help it would make a programmer have a litle more knowledge thanks

    eager to learn

    M 1 Reply Last reply
    0
    • H highjo

      hello guys! I know this question might sound a litle stupid but this my first application and things are still confused for me.I'm developing a data centric application in VB.NET with Visual Studio 2005 that is supposed to connect to sql server installed on the machine or in the network. For exemple in my application project i use the data adapter to connect to the database X with my settings (i mean my user name and password of the sql server on my machine or integrated security) in the connection string on every windowsforms. Then i wanted a way to deploy my application that will create my database during the installation.I liked one of the msdn ways that use the installer class to read an sql file.But i was more interrested by the method used by Mukund PUJARI in his article "create a database during installation version 2".My anxiety is this:if the end user has the freedom to choose the database Y and his location, then my application will definitively not be connected to the database end since my connectionstring is different connection to a database X. In my point of there should be a method that can put in the connectionstring the data provided by the end user.I don't have any idea.Even though i knew and then using data adapters and datasets stuffs how can i make them use it?Supposing i kew it too,it would be then after deployement that i can test that my application is using the database name that i provided during installation. All this are confusing me and if somebody can just help it would make a programmer have a litle more knowledge thanks

      eager to learn

      M Offline
      M Offline
      Michael Sync
      wrote on last edited by
      #2

      You can replace the name of the server, the database name, user name and password at runtime and update the connectionstring in config file. For example: Driver={SQL Native Client};Server={0};Database={1};Uid={2};Pwd={3}; You can replace the string like that ~ String.Format(Driver={SQL Native Client};Server={0};Database={1};Uid={2};Pwd={3}, txtServerName.Text, txtDatabaseName.Text, txtUserName.Text, txtPassword.Text) then, you can update your config file if you want to.

      Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

      H 1 Reply Last reply
      0
      • M Michael Sync

        You can replace the name of the server, the database name, user name and password at runtime and update the connectionstring in config file. For example: Driver={SQL Native Client};Server={0};Database={1};Uid={2};Pwd={3}; You can replace the string like that ~ String.Format(Driver={SQL Native Client};Server={0};Database={1};Uid={2};Pwd={3}, txtServerName.Text, txtDatabaseName.Text, txtUserName.Text, txtPassword.Text) then, you can update your config file if you want to.

        Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

        H Offline
        H Offline
        highjo
        wrote on last edited by
        #3

        hi michael thanks for giving so fast answera though i'm not sur i understood.Right now i don't know how to do such a thing, should it be in the installer class?In my architecture i have about 8 forms and 3 crystalreports and each of them has at least one data adapter.then i add an installer class that use a masterconnectionstring and then change the database master to the one provided by the end user in a user interface.The values entered is past to a variable in the overrided install method(if i'm not wrong).So it 'll read my sql text file to create all the object of this database.How should i implement what you just suggested? Thanks a lot.i went to michael.net not bad :-D

        eager to learn

        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