Click here to Skip to main content
15,878,316 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
I have an excel sheet has data like this

EmployeeName | CityName | JobName
jalal| monaco| officer
ali | paris | doctor

and I have three sql server tables

Employee table

City table

Job table

Assuming that the three tables are empty.

I want to Import the excel sheet to the three table using LINQ to SQL and C#
And Export from Three Tables To excel sheet . Can Any one Help please?

What I have tried:

I don t know anything about importing and exporting data using LINQ C#

1 solution

Consult the provided links below for guidance on how to import/export data to/from SQL using LINQ. These articles offer a detailed, step-by-step explanation, you can write the query according to your table structure.
Importing Excel XLS Files to Database Tables using Linq to SQL[^]
Entity Model to Excel using LINQ in C#[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900