473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Need to create import utility

Hello group!

I need to create import utility. My main concern is how will I support
multiple file types. XLS, CVS, etc? Is there any libraries I can use and
distribute (part of framework?) That will help me do that? Or I have to do
all parsing manually?

Thank you,
Ivan

Oct 24 '08 #1
7 2015
"Ivan" <id*********@bmasoftware.comwrote in message
news:F0**********************************@microsof t.com...
I need to create import utility. My main concern is how will I support
multiple file types. XLS, CVS, etc? Is there any libraries I can use and
distribute (part of framework?) That will help me do that? Or I have to do
all parsing manually?
There is a very good text parser here:
http://www.codeproject.com/KB/databa...ricParser.aspx. It's not perfect,
but it's a good base. I've extended it to include a DbDataReader and a few
other things I felt it was lacking.
Oct 24 '08 #2
There are thrid party controls for working with Excel, but you can also
build an importer for both CSV and Excel with the Microsoft data components
in ADO.NET.

Import from multiple formats is not hard. The hard part is mapping to fields
in your own database. If you have set formats, it is fairly straightforward.
If you have multiple clients with multiple formats, it can get rather
difficult.

For the later scenario, get familiar with at least the factory pattern. It
is also wise to look at Microsoft's provider model and how to set up
"adapters" for your software. The concepts are all similar and basically
come down to treating the UI as a means of pushing the file into a class
that handles the parsing for you.

For mapping fields to internal fields, BizTalk is a nice product. Unless
something has changed in the most recent version, you have to buy an adapter
for Excel from a third party. If this is a shrinkwrap product, a requirement
for BizTalk may throw you out of competition, so consider it carefully.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"Ivan" <id*********@bmasoftware.comwrote in message
news:F0**********************************@microsof t.com...
Hello group!

I need to create import utility. My main concern is how will I support
multiple file types. XLS, CVS, etc? Is there any libraries I can use and
distribute (part of framework?) That will help me do that? Or I have to do
all parsing manually?

Thank you,
Ivan

Oct 24 '08 #3
Yes, it is indeed "later"
I need to import different formats.

It boils down to
1. Specifying type of file (text, XLS)
2. Setting options about delimiters, etc
3. Reading to dataset/datatable
4. Showing UI and allowing user to map stuff
5. Saving "profile" so steps 1-4 would not have to be repeated.

If control like this or library exist - good deal. Otherwise - factory
pattern and so on..

Oct 24 '08 #4
Thanks a bunch. Looks promising.

Is there anything new with Excel object model or it's still interop?

Thank you,
Ivan
Oct 24 '08 #5
On Oct 24, 11:02*am, "Ivan" <idemkovi...@bmasoftware.comwrote:
Yes, it is indeed "later"
I need to import different formats.

It boils down to
1. Specifying type of file (text, XLS)
2. Setting options about delimiters, etc
3. Reading to dataset/datatable
4. Showing UI and allowing user to map stuff
5. Saving "profile" so steps 1-4 would not have to be repeated.

If control like this or library exist - good deal. Otherwise - factory
pattern and so on..
I wrote a program for my current employer that does almost the same
exact thing to some degree. It uses the Microsoft Text ODBC driver to
read CSV and the Microsoft Excel ODBC driver (both come with MDAC) to
read Excel. Both have some shortcomings, for example, the Excel driver
is not capable of reading Excel 2007 format, but there is an optional
OLEDB driver available from Microsoft that can.

Using the ODBC drivers mean that the actual statement that reads the
data from either format is the same, a standard SQL style SELECT
statement. The beauty of that is that it accepts standard SQL WHERE
clauses which make filtering the input very easy.
Oct 24 '08 #6
Yes, I already realized that. Downloaded sample from codeproject which lead
me to research ODBC stuff. Then I went to: http://www.connectionstrings.com/

Looks like it's all I need. Just deal with mappings, etc.

Oct 24 '08 #7
On Oct 24, 7:13*am, "Ivan" <idemkovi...@bmasoftware.comwrote:
Hello group!

I need to create import utility. My main concern is how will I support
multiple file types. XLS, CVS, etc? Is there any libraries I can use and
distribute (part of framework?) That will help me do that? Or I have to do
all parsing manually?

Thank you,
Ivan
Ivan,

This does everything you need:
http://www.codeproject.com/KB/database/filehelpers.aspx

-Jay
Oct 25 '08 #8

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

Similar topics

1
by: Sven | last post by:
Hello, I am receiving a text file that is produced from a mainframe that is out of my control. I am attempting to find a (hopefully clean) way to import it into a SQL Server database in an...
12
by: Guy | last post by:
I got a big Access file (1 400 tables) to convert to SQL and I would like to be provided with some automated tools, except upsizing wizard and DTS, to convert it on my own. I got a lot of forms...
6
by: davvid | last post by:
hello, please I would like to know if it's possible to load data in hierarchical table structure with identity column used as pk (for all the tables) : I mean table root (Id_root(pk,identity...
0
by: DotDidIt | last post by:
Hi Everybody! I developed a Web service with IBM RAD v 6.0.1. After creating the WSDL file i have tried to develop a .Net client. But by using wsdl.exe (1.1.4322) to create a .net c# proxy i...
5
by: Konstantin Andreev | last post by:
Recently I became interested, - Are the data, bulk loaded in the table with LOAD utility, consume the same disk space as loaded with IMPORT utility? The answer turned out to be NOT ! Here is a...
0
by: shubhangi | last post by:
Hi, My m/c has a client installation of sql 2005. Now I'm connecting to sql server 2005 through vpn. But here my import/export utility is disabled. Please can u tell me "is this a feature of...
12
by: Robbo | last post by:
Hi, My database contains 45 tables the structure of which is evolving as I develop. I need a utility that will "read" the structure of this database and it's tables and then create an identical...
6
by: rhaazy | last post by:
I have to create a script to install a database, and one of the tables has about 200 rows of static data... I dont want to have to manually type in 200 insert statements, so is there a better way...
1
by: twin2003 | last post by:
need help with inventory part 5 here is what I have to do Modify the Inventory Program by adding a button to the GUI that allows the user to move to the first item, the previous item, the next...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.