Click here to Skip to main content
15,905,144 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want excel in C#.net page in which user can insert data in excel but before insertion user set how many number of rows and colums he want to insert.When user insert data, that data automatically save in database and i m using Sql Server To save data in database

Along with insertion, user can do other operations like delete/update/select.

Please help me to solve this problem.

Thanks
Twinkle Kumar
Posted

You need to think a bit about what will happen here, what you're asking for isn't really feasable

Excel is a program & for the user to be able to interact with it, it must be installed on their computer. You can't really control Excel on the client from web pages, that would be a massive security hole. (NB: There's a certain amount you can do, but it has to be explicity allowed and permissions set. Best just to forget about it imo )

What you actually want to do is display data in a grid like format and offer the client functionality to work with data before persisting it to the database. For this, something like the GridView component is perfect for your requirements.

Have a look into GridView

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx[^]
 
Share this answer
 
I m Already used Gridview With All options Like Edit / Delete / Update and as well as Cancel. but now i m all things do in Excel Format . This is Possible Or not .

Please Give me some idea

Thanks
 
Share this answer
 
Comments
Dylan Morley 17-Sep-10 5:21am    
No, as explained you can't use Excel like this in a web page. You can use Excel on the server, to create a file or report for example. You can automate Excel on the client (if permissions allowed, they aren't by default) to show Excel to the user.

You cannot control Excel from a web page for data input. Why you would even want to is beyond me.
There is no way of doing what you are after.
Excel is a proprietry product, and it is not set of general web use.

You would also have to have a license for every single person who went to your website.

What you need is a Datagrid, and feed that data into a database.
(If you need functionality, it can be fed into a spreadsheet, but only for your own use.
 
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