Solved

Import multiple related Excel Files into SQL Server with asp.net/c#

Posted on 2013-12-04
1
994 Views
Last Modified: 2014-01-03
I have 4 excel files that I would like to import into a SQL Server database using and asp.net web form. Each of the 4 excel sheets go into 4 different (but related) tables. The excel file records each have an ID field, so you can see which records are related from excel file to excel file. That ID field is not in the SQL Server tables. They have an ID field, but the values are not the same between excel and sql server. Each record will get a new SQL id once it's imported. If this was just one sheet it would not be a problem. But excel file 1 needs to be imported, then each of the other 3 files with related records (but now with a new ID that does not match the SQL id). Is there a way to import by cycling through each record from all files? So the first record in excel file 1 (the parent) is imported into SQL Server and assigned a new ID, then each related record is imported from the other 3 files into their correct tables with the new SQL ID. The on to the next record. It seems quite cumbersome to me. Can something be worked out? Any help is appreciated.
0
Comment
Question by:dodgerfan
[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
1 Comment
 
LVL 5

Accepted Solution

by:
allanau20 earned 500 total points
ID: 39697426
say you imported the 4 excel files into their tables. In each table you should have the common ID field that the 4 tables can share just like you would in the 4 excel files? You can use that ID as the key to join (build relations) to the other tables. You don't have to match on the ID that SQL generated. What issues do you have with using the ID field from excel?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

740 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