By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,694 Members | 2,121 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,694 IT Pros & Developers. It's quick & easy.

How to create a database from a deployment project?

P: n/a
I would like to create a database for my application when it is
deployed.
This database can be from different types depending on the tool
installed on the customer computer and will be chosen during the
startup wizard.
Where do I write the code in the project?
How do I open a new database programmatically?
How do I open a new database and copy data to it from my files
programmatically?
Is there an example explaining this?
Nov 15 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Manu,

You should use the ADOX library through COM interop. ADO.NET doesn't
have a mechanism that supports the altering of the schema of a database.
Right now, you have to use ADOX.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Manu" <ec*@bezeqint.net> wrote in message
news:a3*************************@posting.google.co m...
I would like to create a database for my application when it is
deployed.
This database can be from different types depending on the tool
installed on the customer computer and will be chosen during the
startup wizard.
Where do I write the code in the project?
How do I open a new database programmatically?
How do I open a new database and copy data to it from my files
programmatically?
Is there an example explaining this?

Nov 15 '05 #2

P: n/a
If I understand you correctly, you want your app to create a new database
when it is installed. There is no simple way to do it, but depending on
which DBMS you're using (SQL Server, Access, Oracle, etc) there may be tools
to help generate some of the code. You will want to do this when the program
is run for the first time. The code will most likely involve a lot of SQL
statements such as CREATE DATABASE, CREATE TABLE, etc. There may be examples
out there, but you're best bet is to search Google.
"Manu" <ec*@bezeqint.net> wrote in message
news:a3*************************@posting.google.co m...
I would like to create a database for my application when it is
deployed.
This database can be from different types depending on the tool
installed on the customer computer and will be chosen during the
startup wizard.
Where do I write the code in the project?
How do I open a new database programmatically?
How do I open a new database and copy data to it from my files
programmatically?
Is there an example explaining this?

Nov 15 '05 #3

P: n/a
You want to add a class to your project derived from Installer and add the
class as a Custom Action. There are methods you can override to perform
functions on Install, Uninstall, Commit and Rollback. You can even save
state between Install and Uninstall.

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemconfigurationinstallinstallerclasstopic .asp

"Manu" <ec*@bezeqint.net> wrote in message
news:a3*************************@posting.google.co m...
I would like to create a database for my application when it is
deployed.
This database can be from different types depending on the tool
installed on the customer computer and will be chosen during the
startup wizard.
Where do I write the code in the project?
How do I open a new database programmatically?
How do I open a new database and copy data to it from my files
programmatically?
Is there an example explaining this?

Nov 15 '05 #4

P: n/a
I think you will find this article very helpful..

http://msdn.microsoft.com/library/de...us/vsintro7/ht
ml/vxwlkwalkthroughusingcustomactiontocreatedatabased uringinstallation.asp

Patrick Baker - Visual Basic/Deployment Quality Assurance Team
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "General Protection Fault" <ge*******@nospam.yahoo.com>
References: <a3*************************@posting.google.com>
Subject: Re: How to create a database from a deployment project?
Date: Mon, 6 Oct 2003 09:21:02 -0500
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <ep**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: 66.46.138.11
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:189238
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

You want to add a class to your project derived from Installer and add the
class as a Custom Action. There are methods you can override to perform
functions on Install, Uninstall, Commit and Rollback. You can even save
state between Install and Uninstall.

http://msdn.microsoft.com/library/de...-us/cpref/html /frlrfsystemconfigurationinstallinstallerclasstopi c.asp

"Manu" <ec*@bezeqint.net> wrote in message
news:a3*************************@posting.google.c om...
I would like to create a database for my application when it is
deployed.
This database can be from different types depending on the tool
installed on the customer computer and will be chosen during the
startup wizard.
Where do I write the code in the project?
How do I open a new database programmatically?
How do I open a new database and copy data to it from my files
programmatically?
Is there an example explaining this?



Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.