468,101 Members | 1,399 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,101 developers. It's quick & easy.

File Import Wizard

Hi All. I'm looking for any help or sample code that can show me how to make a file import wizard in ASP.NET (VB preferred) like the one that MS Access uses. I'm working on a web site where the user has the ability to upload a file (.txt or .csv). The data in the file may be comma delaminated, tab delaminated, fixed width etc (we don't know).

What I'd like to create is something like MS Access uses to import an Excel file into the database. Access has a wizard that walks the user through steps such as - is the first row the header, ignore the first "x" number of rows, is it comma, tab, semi colon etc delaminated, allows you to adjust what data goes in what field etc And then does the import into the database. I need to recreate something exactly like this but web-based. I'd also like the user to be able to store their preferences so that the next time they go to upload the same type of file the can just choose a pre-made preference that knows what to do. The file would then get imported into a database (Access or SQL Server).

Any suggestions on where to start or code samples to look at?

Thanks
Nov 21 '05 #1
1 3531
David:

I don't know your exact familiarity with all the aspects of the import
systems for Access and SQL Server so if you are already familiar with this
information, please understand this.

I built a custom import systems for text and Excel files for both Access and
SQL Server, although not web based. However, the principles should be
similar.

Regarding Access, the TransferText and TransferSpreadsheet methods mimic the
functionality of the wizards you mentioned. Access uses the MSysIMEXSpecs
and MSysIMEXColumns system tables to store import (and export)
specifications used by the TransferText method. When you create and save an
import specification using the wizard, these are the tables that hold the
data. I recreated the wizard form and then customized it to my needs. This
should be straightforward for the web, except for maybe the subform.

For SQL Server, I built a custom DTS package and then executed it. I used a
couple of tables similar to the Access system tables previously mentioned to
hold the import specification information. You can create a sample DTS
package for a text file and then save it as VB code to see how such packages
are created. Obviously, DTS gives you much more flexibility in terms of
transforming data during the import process.

I hope this helps.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
"David Berry" <db****@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi All. I'm looking for any help or sample code that can show me how to
make a file import wizard in ASP.NET (VB preferred) like the one that MS
Access uses. I'm working on a web site where the user has the ability to
upload a file (.txt or .csv). The data in the file may be comma
delaminated, tab delaminated, fixed width etc (we don't know).

What I'd like to create is something like MS Access uses to import an Excel
file into the database. Access has a wizard that walks the user through
steps such as - is the first row the header, ignore the first "x" number of
rows, is it comma, tab, semi colon etc delaminated, allows you to adjust
what data goes in what field etc And then does the import into the database.
I need to recreate something exactly like this but web-based. I'd also like
the user to be able to store their preferences so that the next time they go
to upload the same type of file the can just choose a pre-made preference
that knows what to do. The file would then get imported into a database
(Access or SQL Server).

Any suggestions on where to start or code samples to look at?

Thanks
Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by David Berry | last post: by
11 posts views Thread by Grim Reaper | last post: by
3 posts views Thread by mollyf | last post: by
4 posts views Thread by Sam K. | last post: by
reply views Thread by Philip Kline | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.