?
Solved

Installing Custom .NET App and SQL Database

Posted on 2010-01-12
9
Medium Priority
?
234 Views
Last Modified: 2013-11-26
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
Comment
Question by:brian_appliedcpu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
9 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1500 total points
ID: 26304022
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
 
LVL 12

Expert Comment

by:jmcmunn
ID: 26305263

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
 
LVL 12

Expert Comment

by:jmcmunn
ID: 26505509

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
Quick Start: DOCKER

Sometimes you just need a Quick Start on a topic in order to begin using it.. this is just what you need to know to get up and running with Docker!

 
LVL 96

Expert Comment

by:Bob Learned
ID: 26505992
I don't see any point to keeping this question...
0
 
LVL 2

Author Comment

by:brian_appliedcpu
ID: 26509709
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
 
LVL 2

Author Closing Comment

by:brian_appliedcpu
ID: 31676074
Resolved
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question