Installing Custom .NET App and SQL Database
Posted on 2010-01-12
My .NET app can be installed server-side or client-side. Regardless of which side MyApp is installed, it is designed to create a default installation folder, such as C:\Program Files\MyApp (or whatever path the user selects). In addition, it creates several subfolders, one of which is called Textdata.
SQL Server is required on the server-side and during the install, Setup creates a database, plus all the tables, views, stored procedures, etc. After the database and its objects are created, Setup then runs a series of BULK INSERTs that will populate some of the database tables with raw data stored in C:\Program Files\MyApp\Textdata. This works great when MyApp is being installed server-side (on the SQL Server), because the Bulk Inserts look for and find the path C:\Program Files\NETapp\Textdata. But if choosing to do a client-side install of MyApp, then the SQL Server does not find a local C:\Program Files\NETapp\Textdata, since it resides on the client machine, instead of the server.
So my solution was to replace the Bulk Inserts and use SqlClient with ADO.NET to populate the tables during the install. This works, but is extremely slow. What use to be a 3 minute install of MyApp is now taking closer to 30 minutes. During the install, one of the tables is being filled with over 4 million rows of geographical data, and another table is being populated with close to a million rows of related data. This process screamed when using the Bulk Inserts, but not so good with ADO.
I'm looking for suggestions on how I might be able to switch back and use the Bulk Inserts when performing a client-side install, or some other method that would get me back to a faster install.