473,800 Members | 2,738 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1728
On Jun 18, 4:30*pm, Mennovdveen
<Mennovdv...@di scussions.micro soft.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
422
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 fine for the vast majority of users, but not for my colleague & I. When this page is called with the correct inputs, the standard Open/Save/Cancel/More Info dialog should appear. In the dialog, it gives the following details:
2
9654
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? Can a DTS package be fired from a SP using parameters? Eg UPDATE tProjects SET MyField1=XLS.Sheet1.CellA1, MyField2=XLS.Sheet2.CellA1 WHERE ProjectID = @ProjectID. Also, it must handle dynamic XLS file names, eg 981-Budget.xls,
6
3496
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
1615
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. The input to this query is a fairly large (the example I'm working with has 335,000 rows) set of records containing numbers to be looked up in the lookup table. This lookup table has 239 rows.
0
2012
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
3638
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 actually takes 25 seconds on my computer (no other CPU intensive processes running). Is this normal for EXPLAIN ANALYZE to report a total runtime so vastly different from wall clock time? During the "explain ANALYZE delete from msgid;" the CPU is...
16
2220
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: Memory exhausted in AllocSetAlloc(1189) This error is in the FAQ, but that answer does not appear applicable. The error is occurring on 2 different databases, on multiple tables, and all tables involved are frequently updated.
0
4633
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... after converting (exporting), columns in xls must be formatted: A column (FName): text, column width in xls = 25 B column (LName): text, column width in xls = 25 C column (BDate): custom (dd.mm.yyyy), column width in xls = 15 D column (NNum): Number...
1
2002
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 data uit een MDB De mdb wordt gevoed door andere asp-pagina's Tot hier geen probleem
3
2639
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
1
10250
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
9085
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
7574
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
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
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
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2944
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.