0

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?

2
  • 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. Commented 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. Commented Jun 27, 2012 at 14:33

1 Answer 1

3

There is no such smart way. You will have to:

  1. Upload the file.
  2. Connect to Excel using existing ODBC mechanism. Find out connection string for excel.
  3. And do the processing accordingly.
Sign up to request clarification or add additional context in comments.

3 Comments

den what's the use of using MVC? I am Sorry I am new in MVC
@Rahul, MVC is much more but not this. This is where you will have to apply your software development skills.
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.