can anybody help me in this
Installing database while setup
Collapse
X
-
Tags: None
-
i have to install it while installing product
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.Comment
-
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.Comment
-
Well we have doveloped a product in c#
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&deploymen t 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 ...
thankuLast edited by shanthsp2002; Apr 10 '06, 10:09 AM.Comment
-
oky can u give me example plzz
i need some examples
if possible some links to this kind of examples
thankuComment
-
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
SqlCmd help from MSDN
Comment
-
-
Figured it out
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)
hope that helpsCode:private void button1_Click(object sender, EventArgs e) { try { Process RunSQLScript = new Process(); RunSQLScript.StartInfo.FileName = "sqlcmd"; RunSQLScript.StartInfo.Arguments = "-E -S clovis-003 -i c:\\test.sql -o c:\\testData.txt"; RunSQLScript.Start(); } catch(Exception f) { Console.WriteLine("An error occurred: '{0}'", f); } }Comment
-
Hi
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\in staller\debug then i want to store my files in
h:\myproduct\in staller so how to do this
thanku
Regards
prashanthComment
Comment