in the previous blog post, I described the approximate flow of Excel data import and a demo instance Excel Data import ___ Do you hold It (i)
In this article we will take you through the process of importing Excel and the problem solving solution:
Import Excel processes and steps
It is important to note that these lines of code are added to the Server -side Web Config
<!--import Excel Nancy -2015-7-8 ---<appsettings><addkey= "Dbcontextfactoryclassfullename" value= "ITOO. FreshStMaintain.DAL.DbContextFactory "/><add key=" Excelimportxmlpath "value=" Common/importflow "/><add key= "Freshentities" value= "Data source=192.168.24.233;initial catalog=fresh;persist security Info=true;user Id=sa; password=123456; "/> </appSettings>
Ps:<add key= "Excelimportxmlpath" value= "Common/importflow"/> value= "" is based on the naming of the folders in your project, which you can refer to below:
importing Excel issues and Solutions
Because of the inconsistent file name of the configuration file in <add key= "Excelimportxmlpath" value= "Common/importflow"/>server. The XML file for Excel is not found. so the file name must be consistent.
The process of debugging often prompts for this error, which does not affect the last run. Do not affect your own development of the mood.
The error should be carefully analyzed at this time, if the configuration file does not have the word default, it can be wrong from the code, "TimeStamp" or the default value of the English field is consistent with the database
You can now find your own Excel data is empty, or if there is a null value in the property field in the database
When you find that the problem appears in the "Do not see object reference set to object instance", it means that you are not far from success. Not afraid of the wrong code, it is afraid of the program without bugs.
I hope you have always supported my blog and learn to share together.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Excel data Import ___ Do you hold it? (b)