Home > other >  C # data import
C # data import

Time:11-22

MVC project Excel data export steps:
Step 1: convert users to upload files to book
For 1 to 1 file suffix

1-2: determine whether. XLS file (case)

1-3: users to upload files can be converted to binary

1-4: convert binary into workbook

Step 2: table determine whether or not it's data
2-1: determine whether there is a work table

2-2: get to the first sheet

Table 2-3: determine whether or not it's line


The third step: will Excel data is transferred to the DataTable (convenient subsequent values)
3-1: define the DataTable

3-2: access to Excel header columns

3-3: create columns in the DataTable

3-4: obtain the Excel data lines

3-5: import line data in the DataTable



Step 4: remove the incomplete data in the DataTable empty lines
4-1: definition method

4-2: define container storage to be deleted the number of rows

4-3: traverse the incoming tabular data line whether there is any incomplete

4-4: delete incomplete data lines

4-5: method is called delete incomplete data lines

Step 5: will increase to the database DataTable data traversal

5-1: line traversing the Datatable

5-2: get the current line

5-3: create to save object

5-4: to save the field data was obtained from the current line

5-5: to process the data will get assigned to the objects one by one the corresponding field

5-6: saving objects to a temporary container

5-7: one-time submitted to all the data

Conclusion: import the idea (
1. Obtain export data
2. The data into a workbook
2. The workbook data is transferred to the datatable
3. Use the datatable docking database field
4. Save the data

CodePudding user response:

So, What can we do for you?

CodePudding user response:

The building Lord use BBS as a blog in use
  • Related