Database deployment. using VB .net
-
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.
-
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.
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'
-
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'
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.
-
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.
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.
-
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.
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.
-
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.
Sorry, I've never worked with SQL Express, just SQL 2000, 2005 and Oracle. :(
-
Sorry, I've never worked with SQL Express, just SQL 2000, 2005 and Oracle. :(
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.
-
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.
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.”