简体   繁体   中英

Read Excel template using Aspose

Let's say I have a class called User:

public class User
{
        public int ID { get; set; }
        public string Name { get; set; }
        public string Email { get; set; }
        public int? Age { get; set; }
}

And an Excel sheet where the 1st column is ID, 2nd is Name, 3rd is Email and 4th is Age

Is there a way I can tell Aspose to use this template and populate a list of type User based on this Excel template so then I can save it to a database?

If you need to import data from a collection of custom objects to a worksheet, you may try to use Cells.ImportCustomObjects method provided by Aspose.Cells APIs. You will provide a list of columns/properties to the method to display your desired list of objects in the worksheet accordingly, see the topic here for your reference.

I am working as Support developer/ Evangelist at Aspose.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM