I am using ASP.NET DynamicData v4.5 to allow admin to insert/update the records in the database.
My requirement is, -- Allow admin to import records for table from EXCEL file. Source for the table may be available in excel files also. so i want admin to import data from file.
Is there any way i can achieve this in DynamicData ?
Yes you can do it, I've done it many times. There is no built-in feature in Dynamic Data doing this but that's not a problem since it's pretty easy to implement.
The fact that you use ASP.NET Dynamic Data (like I do) is not really important for this task. As you probably know, you can create a regular ASP.NET form within a Dynamic Data project. You can also use a folder named /DynamicData/CustomPages to customize a Dynamic Data page. I suggest creating a new regular ASP.NET form called ImportingTool.aspx where your users will be able to import spreadsheets into your database. Once imported, they can use other dynamic data pages to edit the data.
Here is what you will need :
1- You need the user to upload a file, you will need asp:fileupload or ajaxToolkit:AjaxFileUpload
2- You need to open that file, it will look like :
3- You will need to import that file in your database, it will look like :