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. Database deployment. using VB .net

Database deployment. using VB .net

Scheduled Pinned Locked Moved Visual Basic
databasequestioncsharpsysadminhelp
8 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.
  • C Offline
    C Offline
    Cory Kimble
    wrote on last edited by
    #1

    Is there a way that vb .net can help deploying a SQL database. I want a way I can create an install disc and have the user run the install disc and have the sql database with mdf files install. Does anyone know a way to do this? I know I can run the sql database installer from the setup, but how do I get the mdf files to automatically attach and be usable?

    I can't think of anything cool and nerdy to say.

    D 1 Reply Last reply
    0
    • C Cory Kimble

      Is there a way that vb .net can help deploying a SQL database. I want a way I can create an install disc and have the user run the install disc and have the sql database with mdf files install. Does anyone know a way to do this? I know I can run the sql database installer from the setup, but how do I get the mdf files to automatically attach and be usable?

      I can't think of anything cool and nerdy to say.

      D Offline
      D Offline
      David Mujica
      wrote on last edited by
      #2

      You could write some TSQL to automate the creation of a database, logi, user, tables, views, indexes, etc, and have you clients execute the script. Commands to research: CREATE DATABASE 'MYNEWDATABASE' CREATE LOGIN CREATE USER sp_addrolemember 'db_owner','MYNEWDATABASE'

      C 1 Reply Last reply
      0
      • D David Mujica

        You could write some TSQL to automate the creation of a database, logi, user, tables, views, indexes, etc, and have you clients execute the script. Commands to research: CREATE DATABASE 'MYNEWDATABASE' CREATE LOGIN CREATE USER sp_addrolemember 'db_owner','MYNEWDATABASE'

        C Offline
        C Offline
        Cory Kimble
        wrote on last edited by
        #3

        I wanted to avoid scripts. Is there a way to attach a database using vb .net code?

        I can't think of anything cool and nerdy to say.

        D 1 Reply Last reply
        0
        • C Cory Kimble

          I wanted to avoid scripts. Is there a way to attach a database using vb .net code?

          I can't think of anything cool and nerdy to say.

          D Offline
          D Offline
          David Mujica
          wrote on last edited by
          #4

          Hmm, I must have misunderstood you. :confused: I thought you were looking for a solution to "deploy" a database. To me "deploying" a database at a client site means that they have a server waiting for you and a database needs to be created, schema created and populated, then your application can run. If all you need to do is "attach", then why can't you just have your connection string stored in a configuration file and have it load at run time. I must be missing something. "deploy" and "attach" have different meanings for us. Maybe someone else can chime in a provide a soltion for you.

          C 1 Reply Last reply
          0
          • D David Mujica

            Hmm, I must have misunderstood you. :confused: I thought you were looking for a solution to "deploy" a database. To me "deploying" a database at a client site means that they have a server waiting for you and a database needs to be created, schema created and populated, then your application can run. If all you need to do is "attach", then why can't you just have your connection string stored in a configuration file and have it load at run time. I must be missing something. "deploy" and "attach" have different meanings for us. Maybe someone else can chime in a provide a soltion for you.

            C Offline
            C Offline
            Cory Kimble
            wrote on last edited by
            #5

            Can you help me with this? I can create database (mdf) now I need to attach it to the sql instance. How can I do that in vb .net?

            I can't think of anything cool and nerdy to say.

            D H 2 Replies Last reply
            0
            • C Cory Kimble

              Can you help me with this? I can create database (mdf) now I need to attach it to the sql instance. How can I do that in vb .net?

              I can't think of anything cool and nerdy to say.

              D Offline
              D Offline
              David Mujica
              wrote on last edited by
              #6

              Sorry, I've never worked with SQL Express, just SQL 2000, 2005 and Oracle. :(

              C 1 Reply Last reply
              0
              • D David Mujica

                Sorry, I've never worked with SQL Express, just SQL 2000, 2005 and Oracle. :(

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                SQL Express is SQL 2005 with some limitations on the number of connections

                Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                1 Reply Last reply
                0
                • C Cory Kimble

                  Can you help me with this? I can create database (mdf) now I need to attach it to the sql instance. How can I do that in vb .net?

                  I can't think of anything cool and nerdy to say.

                  H Offline
                  H Offline
                  Henry Minute
                  wrote on last edited by
                  #8

                  If you haven't already done so, download the SqlServer samples (theyr'e on CodePlex now not MS Download) here[^], select the *.zip file if you want to select where to put them, or the *.msi file if you want them installed to your SQLServer Directory. There's a shedload of useful routines, mini applications and utilities in there. The one you want isn't, from memory, but it is here on MSDN - Server.AttachDatabase Method[^]

                  Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                  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