Hi,
I have excelsheet is -
Id Description1 Name1 Description2 Name2
1 descname1 testname1 descname2 testname2
Now in my database table is:
name Description(two columns)
now in db table I want to insert :
Description Name
descname1 testname1
descname2 testname2
Is it possible if yes how I will get???
Please help....
Howard MahaffeyPosted Sep 4, 2015, 5:41 AM
rachayita jaiswalPosted Aug 27, 2014, 12:52 AM
is there any other way because in these examples thet are showing how we can use linqtoexcel and they are using a normal excel tablw here only two column are there :
name , birthdate like that...
but in my scenario its different can you check my post how is excel sheet column name and how I need to insert in database table.
thanks,
R JPosted Aug 27, 2014, 12:18 AM
Here is some sample
var excel = new ExcelQueryFactory("excelFileName");
var indianaCompanies = from c in excel.Worksheet<Company>()
where c.State == "IN"
select c;
you can retrieve specific rows with specific columns... so you can dump this data into datatable and pass it to DB
more samples are there is in this url
https://github.com/paulyoder/LinqToExcel
if you see any exceptions/issues post them,
rachayita jaiswalPosted Aug 26, 2014, 11:47 PM
can you please give code for this if possible.
thanks,
R JPosted Aug 26, 2014, 3:02 PM
https://code.google.com/p/linqtoexcel/
In your scenario, when you use linqtoexcel you can retrieve specific rows with specific columns... so you can dump this data into datatable and pass it to DB. Hope this helps.
let me know if you see any issue.