473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Installing database while setup

can anybody help me in this
Apr 5 '06 #1
20 7398
CaptainD
135 100+
We'll need a little more information then that. What type of database, where is it going etc.
Apr 5 '06 #2
while installing product iuser can select database installation by checking chekbox then i have to install database on his system, database meanse in sql server.
Apr 6 '06 #3
CaptainD
135 100+
Sorry, still not enough information, what product, did you create it, if so, in what language.

With what we have so far.

As far as creating the database, with MS Sql Server (and I assume others) you can create a script that will create the database. Create the script, design your program (If you wrote it) to connect to the server and run the script.
Apr 7 '06 #4
Niheel
2,460 Expert Mod 2GB
Hmm, maybe i need to setup a post guidelines.
Apr 7 '06 #5
Banfa
9,065 Expert Mod 8TB
Hmm, maybe i need to setup a post guidelines.
Definately, I have been thinking the same thing for several weeks. I might even chip in and write some myself :D
Apr 7 '06 #6
we have doveloped a product in c# and it has diffrent applications ie.

according to the clients role we have to install database . for ur clear idea
i have created a custom diloguebox in setup&deployment project it looks some what like

() cashier
() central server option button
() manager

[] install database checkbox

if user selects manager then only the installdatabase checkbox will be enabled and if he checks it we have to install local database. so i need some way to install or attach database to his local sql server using c#.net


I hope u understand this, n expecting a goo help from u ...
thanku
Apr 10 '06 #7
CaptainD
135 100+
Use SQL server (I'm assuming MS SQL Server) to create the scripts to build each of the databases. Then, based off the selection, connect to the database and run the script for that database.
Apr 10 '06 #8
i need some examples

if possible some links to this kind of examples



thanku
Apr 11 '06 #9
CaptainD
135 100+
I did some research and ran a test through VB6 (I'm learning C#)

I used the Shell feature and ran osql with the command line arguments and it worked. You'll need to write the code for C# to do the same. When I get time later I'll see what I can do in C#.

Here is some info on both programs.

If you're installing on SQL Sever 2005 then you'll use a program call SqlCmd.exe otherwise oSql.exe

OSql help from MSDN

http://support.microsoft.com/default...-us;325003#kb1

SqlCmd help from MSDN

http://msdn2.microsoft.com/en-us/lib...4(SQL.90).aspx
Apr 11 '06 #10
CaptainD
135 100+
If you need all the command line arguments go to the command prompt and run osql /? or sqlcmd /?

That will give you a listing of all the command line arguments for each
Apr 11 '06 #11
thanku for the help
Apr 12 '06 #12
CaptainD
135 100+
Took some research but I got it to work in C#. My biggest catch was C# requires two "\\" for the drive spec where I entered one "\"
("C:\\" instead of "C:\") The following code will run a SQL Script. In my case I wrote a script to query a database and put the data in a text file. your SQL script will create the database. (Through Enterprise manager, right click over the database, all task, Generate sql script and set the properties under Options)

Expand|Select|Wrap|Line Numbers
  1.         private void button1_Click(object sender, EventArgs e)
  2.  
  3.         {
  4.             try
  5.             {
  6.            Process RunSQLScript = new Process();
  7.            RunSQLScript.StartInfo.FileName = "sqlcmd";
  8.            RunSQLScript.StartInfo.Arguments = "-E -S clovis-003 -i c:\\test.sql -o c:\\testData.txt";
  9.            RunSQLScript.Start();
  10.             }
  11.            catch(Exception f)
  12.             {
  13.                 Console.WriteLine("An error occurred: '{0}'", f);
  14.             }
  15.  
  16.         }
  17.  
hope that helps
Apr 12 '06 #13
I got another question, while installing i have to give the source path of the .mdf and .ldf files so that i can copy these in to Sql Servers Data folder and from there i can attach them to server but, how to specify the source path of these files. if i give source path of custom action property then it is a debug folder of the installer so when i build it all the files in that folder are being re-generated. so how do i do that. Is there any way to refer to the parent folder of this installer folder ie if the installer folder is

h:\myproduct\installer\debug then i want to store my files in

h:\myproduct\installer so how to do this


thanku
Regards
prashanth
Apr 13 '06 #14
CaptainD
135 100+
I dont know the answer to that one. you might want to start a new thread and see if someone else can answer it for you. I've never created a custom action. I did look it up on MSDN but I did not see anything pointing me in that direction.
Apr 13 '06 #15
To find the source path of my database files just i have used a small trick
here first i srored the path to my database files in a string variable it contains all path except the drive name because we can't say in clint sys what is drive name of cd drive so i get this drive from source path

Expand|Select|Wrap|Line Numbers
  1.  private string GetConfigFilePath(string fpath) 
  2. {
  3.     string filePath = "";
  4.     string dd = "";
  5.     string Resources=@"\application\databasefolder\";    
  6.     dd=sourcePath.Substring(0, 3);
  7.     string strConfigLoc = dd + Resources
  8.     string strTemp = System.IO.Path.GetDirectoryName(strConfigLoc).ToString();
  9.  
  10.     filePath = strTemp+@"\";
  11.     EventLog.WriteEntry("filepath", filePath , EventLogEntryType.SuccessAudit);
  12.     return filePath;
  13.  
  14. }
  15.  
Apr 15 '06 #16
CaptainD
135 100+
I like your solution. I was trying to find the equivilant to VB6's "App.Path" but was unable to locate it. What namespace is "SourcePath" under?
Apr 15 '06 #17
SourcePath is not from namespace. do one thing , in custom action editor

|
----Install
..........|
...........---UrCustomAction.dll

----Commit
----RollBack
----Uninstall

go to properties of that UrCustomAction.dll is what ever ur custom action file
in that

CustomActionData property is there

enter following in to that property

/SourceFolder="[SourceDir]\" /DestinationFolder="[TARGETDIR]\"


here [SourceDir] is source folder of ur custom action dll


njoy n all the best
Apr 18 '06 #18
How to find werther the SqlExpress is installed on current machine or not


i need this to install Sqlexpress on selection of client but i have to check first werther its alredy installed in sys
Apr 18 '06 #19
if u want just go through this link


http://msdn.microsoft.com/library/?u...LExCustApp.asp




All the best friends

regards
Prashanth
Apr 18 '06 #20
Hi friends , i am developing a setup and deployment project for our application here i have to include two other applications with our product installer, and they must be installed only when use selects them. can any body have any idea abt this

just how to create nested installer. clear idea


thank u
Apr 21 '06 #21

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: yossi | last post by:
Hello. I'm trying to install Oracle 9i Rel 2 on Windows 2000 server. During the installation I choose to create a general purpose database, and choose all the default options. Everything...
2
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
0
by: Chris Halcrow | last post by:
Hi I've spent ALL DAY trying to re-install SQL Server 2000 on Windows XP. I continually get the error 'cannot configure server' just at the end of the installation. I've tried the following: ...
5
by: Gerald Hernandez | last post by:
One of my development PC's died, and I need to have legacy VS and VS.Net installed at the same time. On the now dead PC, I had VS6 installed prior to installing VS.Net. This worked just fine. On...
10
by: Ed Stevens | last post by:
A tale of woe, and a question . . . Last week my boss said to me "we've installed DB2 Connect on this Solaris box. Make it work." Now, I've barely seen DB2 Connect on Windows, having fumbled...
0
by: C. Hughes | last post by:
Hi, I have used the standard tools in VS 2005 to compile my VB application into a setup file. After executing the setup file and installing the program, starting the program often presents an...
1
by: vijaykumars | last post by:
+-----------------------------------------------------------------------------+ Summaries: +-----------------------------------------------------------------------------+ Installation...
2
by: Aussie Rules | last post by:
Hi, I have a vb.net application that uses a SQL Express database. The end user already has SQL Express setup on there server, but they have no skills at using it. Is there a way I can have my...
0
by: Chris Leonard | last post by:
James - you could be running into a known issue with installing Oracle8i software on a P4. Here is a plain-text section of our internal documentation of the issue: Subject/Title: Installing...
3
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi all! I am having problems on installing .NET Framework 3.5 on some machines. In one machine the error is: '.NET Framework 3.5' RunCheck result: Install Needed Verifying file integrity of...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.