Link to home
Start Free TrialLog in
Avatar of virafh
virafh

asked on

integrate excel in asp.net

Dear Friends,

i want to integrate excel with sql server

the user make the changes in excel and the data will save in sql server

thanx
Avatar of Dhanasekaran Sengodan
Dhanasekaran Sengodan
Flag of India image

try this code


Insert into <tablename> Select * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\test.xls;HDR=YES', 'SELECT * FROM [sheet1$]')


above directly execute in Query window change the Excel Path(D:\test.xls)
Avatar of virafh
virafh

ASKER

thanks buddy

in the table columns there is Id which is primary key
and if i use ur logic then what about data which is already in sql server and
if i insert the excel data which is a copy the old sql then 2 entries added of same data,
if i delete the old data and then insert data from excel then the Id column which is auto generated and other tables what refer that filed as foreign key, then what ?

its break the table.

is it possible the user will see the excel in asp.net page


thanx
Avatar of virafh

ASKER


thanx anv

but i requirement is user work on excel sheet and its saved in db
not datagrid
it was for your point:
>>is it possible the user will see the excel in asp.net page
ASKER CERTIFIED SOLUTION
Avatar of virafh
virafh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial