running DB scripts during installation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hayk Khachikyan

    running DB scripts during installation

    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 "OleDbComma nd" (or
    SqlCommand, if target is Sql server only)
    class's "ExecuteNonQuer y" 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 "ExecuteNonQuer y"). 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

    [color=blue]
    >-----Original Message-----
    >I'm working on a Web Setup App and although its been a
    >rollercoaste r ride, I think I'm doing ok so far.[/color]
    However,[color=blue]
    >I can't find any documentation on how to run a DB script
    >during the installation.
    >
    >advice?
    >.
    >[/color]
Working...