PC Review


Reply
Thread Tools Rate Thread

Analyze .SQL, .CSV and .XLS-files

 
 
Mennovdveen
Guest
Posts: n/a
 
      18th Jun 2008
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!!!

 
Reply With Quote
 
 
 
 
Pavel Minaev
Guest
Posts: n/a
 
      18th Jun 2008
On Jun 18, 4:30*pm, Mennovdveen
<Mennovdv...@discussions.microsoft.com> wrote:
> 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.
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sql files analyze tool Alhambra Eidos Development Microsoft C# .NET 0 15th Oct 2009 04:47 PM
how to analyze dump files? chrisandkerry Windows XP General 4 27th Oct 2005 05:40 PM
Analyze Excel files structure Ramon N. Gene Microsoft Excel Programming 0 4th Aug 2004 10:55 PM
Analyze Excel files structure Ramon N. Gene Microsoft Excel Misc 0 4th Aug 2004 10:01 PM
Analyze Excel files structure =?Utf-8?B?UmFtb24=?= Microsoft Excel Programming 0 4th Aug 2004 08:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:28 AM.