?
Solved

integrate excel in asp.net

Posted on 2009-12-22
7
Medium Priority
?
385 Views
Last Modified: 2013-11-08
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
0
Comment
Question by:virafh
  • 3
  • 2
  • 2
7 Comments
 
LVL 14

Expert Comment

by:Dhanasekaran Sengodan
ID: 26102932
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)
0
 

Author Comment

by:virafh
ID: 26103262
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
0
 
LVL 10

Expert Comment

by:anv
ID: 26103273
0
Industry Leaders: 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!

 

Author Comment

by:virafh
ID: 26103281

thanx anv

but i requirement is user work on excel sheet and its saved in db
not datagrid
0
 
LVL 10

Expert Comment

by:anv
ID: 26103508
it was for your point:
>>is it possible the user will see the excel in asp.net page
0
 

Accepted Solution

by:
virafh earned 0 total points
ID: 26103532
0
 
LVL 14

Expert Comment

by:Dhanasekaran Sengodan
ID: 26103584
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

862 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