I want to upload an Excel File using (HTML.Input) in some folder in server and also want to extract data from it and put that data in database. So Is there any smart way in MVC Asp.net to upload and extract and then put data in database?
-
haacked.com/archive/2010/07/16/… I got a link but unfortunately It just tell me to upload it to the server,It does not supply file to the Model Binder from where i can Extract the File.RL89– RL892012-06-27 14:26:55 +00:00Commented Jun 27, 2012 at 14:26
-
Model binder will not come to picture in this case. You upload the file to server and then process excel the way you want.Pradeep– Pradeep2012-06-27 14:33:23 +00:00Commented Jun 27, 2012 at 14:33
Add a comment
|
1 Answer
There is no such smart way. You will have to:
- Upload the file.
- Connect to Excel using existing ODBC mechanism. Find out connection string for excel.
- And do the processing accordingly.
3 Comments
RL89
den what's the use of using MVC? I am Sorry I am new in MVC
Pradeep
@Rahul, MVC is much more but not this. This is where you will have to apply your software development skills.
RL89
thanx Pradeep, I found HttpFileCollectionValueProvider in the link i mentioned above. HttpFileCollectionValueProvider which supplies the uploaded files to the model binder.Also notice that the argument name, file, is the same name as the name of the file input. This is important for the model binder to match up the uploaded file to the action method argument.