Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

Installing Custom .NET App and SQL Database

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.
0
brian_appliedcpu
Asked:
brian_appliedcpu
  • 2
  • 2
  • 2
1 Solution
 
Bob LearnedCommented:
You might be able to use the System.Data.SqlClient.SqlBulkCopy to perform the bulk inserts.  It would require loading the text into a DataTable, and then writing that table to the SQL Server database.
0
 
jmcmunnCommented:

You could probably take advantage of administrative shares on the workstations in a lot of cases (\\<machinename>\C$) and get to the text files from the server that way.  So your path would be build based on the machine name doing the install.

I assume that when the app is installed client side that there is some dialog where the user chooses where the SQL server is?  Perhaps at this time you could also make them choose a path on the network that is accessible to both the workstation AND the server, and at that point copy the textdata into that network folder.  Change the path in the bulk insert commands to be the network directory and you're good to go.

Hope this helps...
0
 
jmcmunnCommented:

There was a possible solution given with no response given from the original poster.  I feel the solution could be useful to others and should not be deleted.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Bob LearnedCommented:
I don't see any point to keeping this question...
0
 
brian_appliedcpuAuthor Commented:
The reasonable solution we determined best in our case was to create a multipart install:
A Server (SQL) install
A Client/Server install
A Client install
All similar to the way most client/server apps install.

Thanks for the input
0
 
brian_appliedcpuAuthor Commented:
Resolved
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now