Solved

Import excel data to sql database using a c# service

Posted on 2007-11-29
2
470 Views
Last Modified: 2008-02-01
I am looking to find some sample c# code that will help me understand how to take data from and excel sheet and insert into a table in an sql database. Basically, I have an ap that the user can browse for the saved excel file, then click an upload button to process the insert. The excel sheet has aprox 16000+ rows and some of the data will have blank fields, so I would like to add a check in the code to catch the blank fields.Thanks for the help
0
Comment
Question by:matzilla
2 Comments
 
LVL 15

Accepted Solution

by:
Solar_Flare earned 250 total points
ID: 20377882
you can query an excel file using SQL with JET

http://support.microsoft.com/kb/311731

you would need to save the uploaded file temporarily so you can query it with JET. Once you get your results you can loop through them checking for nulls and inserting them into your DB.
0
 

Author Comment

by:matzilla
ID: 20381650
Cool, thats exactly what I needed to get started. Thanks
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now