Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Import excel data to sql database using a c# service

Posted on 2007-11-29
2
Medium Priority
?
481 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 1000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

972 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