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

running DB scripts during installation

P: n/a
Hi Angela,

Although I'm not familiar with capabilities of
InstallShild's and the likes of it, you can easily
accomplish what you want in the following manner:
write a small tool that takes the scripts as string input
(e.g., from command-line), then use the "OleDbCommand" (or
SqlCommand, if target is Sql server only)
class's "ExecuteNonQuery" method, where you can run any
SQL script. It'll do the job for you.
As you see, rather trivial to write it (just connect to
data source, instantiate OleDbCommand, and run the script
(s) via "ExecuteNonQuery"). Then you just run this setup
utility from your installation program.

That assumes the target computer doesn't have an
application like SQL Server's Enterprise Manager or even
the QueryAnalyzer installed. If it has, then you can
accomplish what you want without coding.

Hope this helps..
Hayk

-----Original Message-----
I'm working on a Web Setup App and although its been a
rollercoaster ride, I think I'm doing ok so far. However,I can't find any documentation on how to run a DB script
during the installation.

advice?
.

Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.