Solved

Import excel data to sql database using a c# service

Posted on 2007-11-29
2
473 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

733 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