473,915 Members | 4,411 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Oct 2 '05 #1
2 3094
Hi David,

Welcome to MSDN newsgroup.
From your description, you're wanting to build a file import system which
allow the client user to provide some files (some wellknown format) and
then import the file content as records into the database server, also the
system is web based, yes?

As for such application, I think we can separate it into two parts:

1. In the ASP.NET web page, we provide a wizard like UI to collect
information from the clientuser, also use a <input file ..> element to let
the client user upload file. Then, when the user submit the page, the data
and file will be posted to the server for processing.

2. In the ASP.NET webapp's serverside, we just use our serverside code
logic to parse the uploaded file stream and loop through the text datas in
it and build SQL data execution command to insert data into database. This
is the same as we programmaticall y import a file into database in winform
or console application, you can make the parsing and accessing database's
code into a separate component.

Currently I haven't found any existing code samples, if you have any
further and more detaild question, we can have some further discussion on
them.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: "David Berry" <db****@mvps.or g>
| Followup-To: microsoft.publi c.dotnet.langua ges.vb
| Subject: File Import Wizard
| Date: Sun, 2 Oct 2005 11:50:56 -0400
| Lines: 83
| MIME-Version: 1.0
| Content-Type: multipart/alternative;
| boundary="----=_NextPart_000_ 000A_01C5C747.8 CD60990"
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
| Message-ID: <#Y************ **@TK2MSFTNGP14 .phx.gbl>
| Newsgroups:
microsoft.publi c.dotnet.genera l,microsoft.pub lic.dotnet.lang uages.vb
| NNTP-Posting-Host: adsl-64-252-4-30.adsl.snet.ne t 64.252.4.30
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| Xref: TK2MSFTNGXA01.p hx.gbl microsoft.publi c.dotnet.langua ges.vb:108605
microsoft.publi c.dotnet.genera l:51140
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
|
| 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
|

Oct 3 '05 #2
Hi David,

How are you doing on this issue. Does the suggestions in my last reply help
a little? If there're anything else we can help, please feel free to post
here.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
--------------------
| X-Tomcat-ID: 56268410
| References: <#Y************ **@TK2MSFTNGP14 .phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: st*****@online. microsoft.com (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Mon, 03 Oct 2005 03:51:26 GMT
| Subject: RE: File Import Wizard
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
| Message-ID: <lz************ *@TK2MSFTNGXA01 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.genera l
| Lines: 88
| Path: TK2MSFTNGXA01.p hx.gbl
| Xref: TK2MSFTNGXA01.p hx.gbl microsoft.publi c.dotnet.genera l:51152
| NNTP-Posting-Host: tomcatimport2.p hx.gbl 10.201.218.182
|
| Hi David,
|
| Welcome to MSDN newsgroup.
| From your description, you're wanting to build a file import system which
| allow the client user to provide some files (some wellknown format) and
| then import the file content as records into the database server, also
the
| system is web based, yes?
|
| As for such application, I think we can separate it into two parts:
|
| 1. In the ASP.NET web page, we provide a wizard like UI to collect
| information from the clientuser, also use a <input file ..> element to
let
| the client user upload file. Then, when the user submit the page, the
data
| and file will be posted to the server for processing.
|
| 2. In the ASP.NET webapp's serverside, we just use our serverside code
| logic to parse the uploaded file stream and loop through the text datas
in
| it and build SQL data execution command to insert data into database.
This
| is the same as we programmaticall y import a file into database in winform
| or console application, you can make the parsing and accessing database's
| code into a separate component.
|
| Currently I haven't found any existing code samples, if you have any
| further and more detaild question, we can have some further discussion on
| them.
|
| Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
|
|
|
|
|
|
|
| --------------------
| | From: "David Berry" <db****@mvps.or g>
| | Followup-To: microsoft.publi c.dotnet.langua ges.vb
| | Subject: File Import Wizard
| | Date: Sun, 2 Oct 2005 11:50:56 -0400
| | Lines: 83
| | MIME-Version: 1.0
| | Content-Type: multipart/alternative;
| | boundary="----=_NextPart_000_ 000A_01C5C747.8 CD60990"
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
| | Message-ID: <#Y************ **@TK2MSFTNGP14 .phx.gbl>
| | Newsgroups:
| microsoft.publi c.dotnet.genera l,microsoft.pub lic.dotnet.lang uages.vb
| | NNTP-Posting-Host: adsl-64-252-4-30.adsl.snet.ne t 64.252.4.30
| | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
| | Xref: TK2MSFTNGXA01.p hx.gbl microsoft.publi c.dotnet.langua ges.vb:108605
| microsoft.publi c.dotnet.genera l:51140
| | X-Tomcat-NG: microsoft.publi c.dotnet.genera l
| |
| | 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
| |
|
|

Oct 5 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
12795
by: Joshua Ammann | last post by:
Hello, I'm trying to export a query containing contact information, including a field. Some zip codes have one or two leading zeros, for example, San Juan, PR (00927) and Springfield, MA (01104). When I export to a comma separated value (.csv) file, the zip code for San Juan becomes "927" and for Springfield becomes "1104". How can I prevent the leading zero(s) from being trimmed in the exported .csv file? Because the table contains...
11
3435
by: Grim Reaper | last post by:
I am importing a .csv file into Access that has 37 fields. My problem is that sometimes the last field only has data at the end of the column (it looks like when you import a file into Access, for the last field, it only checks the top few 'cells' to see if there is any data, if not, the field is not imported). How do I 'force' Access to import the field, regardless if there is data in the top of the field or not? For instance, I might...
1
3690
by: sparks | last post by:
I have never done this and wanted to ask people who have what is the best way. One person said import it to excel, then import it into access table. but since this will be done a lot, I am trying to avoid this extra step. can access read in this file directly into a table as append data? thank you very much for any pointers
2
3937
by: kuhni | last post by:
Hi everybody, I am totally desperate because I cannot solve a really simple problem: I have a specific text-file which I want to import into an existing database. The problem is that the columns have different names so I receive an error message when importing via the "Get External Data"-Wizard. The second problem is that this text file includes several rows without any relevant data, only symbols like "-----" in the various columns. I...
3
9743
by: mollyf | last post by:
Hello all-- I'm working on a legacy Access 2000 application which imports a space delimited text file. There's a line of code: DoCmd.TransferText acImportFixed, "ClaimSpecsEDS", "ImportedClaims", Me!txtLocation which I know is importing the text file. From reading, I know that the "ClaimSpecsEDS" referred to in the line of code is the specification
2
483
by: David Berry | last post by:
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...
4
1693
by: Sam K. | last post by:
I have a database file in MS Works that has a .wdb extension. I would like to convert it to use in Access or Excel or Word. Is that possible, and, if so, how do I do it? Thanks in advance. Sam K.
8
9672
by: shenkel55 | last post by:
I'm using Access and Excel 2003. Using either the import wizard or code, I have the same problem. This problem only happens with Excel files automatically generated by Corp IT. If I try to do an import and the Excel file isn't open I get the following error: "The wizard is unable to access information in the file "...path info... "Please check that the file exists and is in the correct format." If the files are opened directly in Excel, it...
0
9881
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11354
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10923
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11066
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9732
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5943
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3368
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.