473,320 Members | 1,953 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,320 software developers and data experts.

Analyze .SQL, .CSV and .XLS-files

Goodday,

I'm stuck building a .NET-application.

The purpose of the application is checking for empty records in a
database-exportfile.
The user gives a 'csv, .xls or .sql file. The application analyses it, after
the user selected the table.

The problem is, i can't get the application to read the exportfile.
How can i program it to read the tables and how can i program it to search
the database and return back with the right records. Is this just plain SQL?
Thanks in advance!!!

Jun 27 '08 #1
1 1707
On Jun 18, 4:30*pm, Mennovdveen
<Mennovdv...@discussions.microsoft.comwrote:
Goodday,

I'm stuck building a .NET-application.

The purpose of the application is checking for empty records in a
database-exportfile.
The user gives a 'csv, .xls or .sql file. The application analyses it, after
the user selected the table.

The problem is, i can't get the application to read the exportfile.
How can i program it to read the tables and how can i program it to search
the database and return back with the right records. Is this just plain SQL?

Thanks in advance!!!
.csv is "comma-separated values". There are plenty of third-party .NET
libraries to parse that, a quick Google search will give you a lot of
hits. Here's one example: http://www.filehelpers.com/

.xls is, obviously, an Excel file. You might want to use VSTO (Visual
Studio Tools for Office) to extract data from it, but then your
application will require Excel to be installed.

.sql is, as the extension implies, a collection of SQL statements. In
general, there are many incompatible SQL dialects out there, and
without knowing which one is which, it can be impossible to parse it.
But if it only contains INSERTs, then there is hope. The most
straightforward (if not very efficient) way of handling such a file is
to create a temporary database (using e.g. SQL Server CE), read all
statements from the .sql file and execute it on the database, and then
read all data from the database as usual (SqlDataReader etc).
Otherwise, you'll need to write your own SQL parser.
Jun 27 '08 #2

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

Similar topics

1
by: CJM | last post by:
I have a page which allows the user to open one of several spreadsheets by streaming the XLS to the client. On my development site, everything appears to work fine. On the live site, it works...
2
by: BigJohnson | last post by:
I'm trying to use DTS to import data from an XLS into a SQL table. It works fine in that it INSERT's the data. However, I need it to UPDATE the table, based upon a ProjectID. Can this be done? ...
6
by: Holger Marzen | last post by:
Hi all, the docs are not clear for me. If I want (in version 7.1.x, 7.2.x) to help the analyzer AND free unused space do I have to do a vacuum vacuum analyze or is a
3
by: Harry Broomhall | last post by:
I asked earlier about ways of doing an UPDATE involving a left outer join and got some very useful feedback. This has thrown up a (to me) strange anomaly about the speed of such an update. ...
0
by: Rajesh Kumar Mallah | last post by:
Greeting, Will it be an useful feature to be able to vacumm / analyze all tables in a given schema. eg VACUUM schema.* ; at least for me it will be a good feature.
5
by: Jon Lapham | last post by:
I have been using the EXPLAIN ANALYZE command to debug some performance bottlenecks in my database. In doing so, I have found an oddity (to me anyway). The "19ms" total runtime reported below...
16
by: Ed L. | last post by:
I'm getting a slew of these repeatable errors when running ANALYZE and/or VACUUM ANALYZE (from an autovacuum process) against a 7.3.4 cluster on HP-UX B.11.00: 2004-09-29 18:14:53.621 ERROR:...
0
by: Nebojsa4 | last post by:
How to convert some records from MDB table to XLS file? Example: In the TEST.MDB I have table NAMES and fields: FName, LName, BDate and NNum. I need to convert this records in XLS but... ...
1
by: Charlotte | last post by:
Hallo, Graag hulp, want ik heb zelf geen oplossing Al gegoogeld, doch zonder concreet resultaat Op onze webserver (intranet) hebben we een website draaien Een bepaalde ASP-pagina haalt zijn...
3
by: rabtree | last post by:
Hi All, I have to two xls file named test1.xls and test2.xls In test1.xls sheet contain 3 colunm 1.Sr.No 2.Case Name 3.Validation case
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.