Read contents of excel and create new List based on excel

HI,
I have a excel file, which is uploaded in a document library. I am using C# and VS 2010.
The excel file contains multiple sheets. I want to read the contents of the excel file and create a new List based on the contents of the excel file.
How to achieve this programmatically?
Thanks

Hi.
You can user OpenXML SDK to read excel Data.
http://msdn.microsoft.com/en-us/library/office/bb448854.aspx
Here an example of use.
http://zsvipullo.blogspot.it/2011/08/excel-helper-leggere-un-file-xlsx.html
Regards,
Bubu
http://zsvipullo.blogspot.it
Please mark my answer if it helped you, I would greatly appreciate it.

Similar Messages

  • Event Receiver to create a List based on a custom template and on lookup field

    Hi
    I would like to have an Event Receiver who is firing by addItem in a list calls Seminarliste and is creating each time a new list based on three columns for add.Lists("Title of the list", "Description of the list", "Custom List
    Template")
    I have a Problem to get the LookupField Title and I am getting a Problem to create a list.
    If I debug the code the bold line creates an exception ;(
    The following code I have produced:
            public override void ItemAdding(SPItemEventProperties properties)
                base.ItemAdding(properties);
                SPWeb spCurrentSite = properties.OpenWeb();
                SPSite siteCollection = new SPSite("http://win-ue32d37ap2n");
                SPWeb web = siteCollection.OpenWeb();
                SPListCollection lists = web.Lists;
                String curListName = properties.ListTitle;
                if(curListName == "Seminarliste")
                    SPListItem curItem = properties.ListItem;
                    String curItemListName = properties.AfterProperties["Title"].ToString();
                    String curItemDescription = properties.AfterProperties["Beschreibung"].ToString();
                    // Lookup field with Option to Chose a template name
                    String curItemTemplate = properties.AfterProperties["Template"].ToString();
                    SPListTemplateCollection listTemplates = siteCollection.GetCustomListTemplates(web);
                    //Error by following line ...
    SPListTemplate myTemplate = listTemplates[curItemTemplate];
                    web.Lists.Add(curItemListName, curItemDescription, myTemplate);
    If somebody had a similar problem in the past and could advice it would be most appreciated ;-)
    Thanks in advance ;-)
    Kind regards Michael Damaschke

    If I understand correctly, the field you use to select the template name is a lookup field? If so, then the problem is the lookup field value is not the name of the template. It is an SPFieldLookupValue, which contains the ID and the string of the lookup.
    So you want to separate the template name, like this:
    if (item["LookupField"] !=
    null)
         string fieldValue = item["LookupField"].ToString();
         SPFieldLookupValue value =
    new SPFieldLookupValue(fieldValue);
         int lookupListItemID = value.LookupId;
         string lookupListValue = value.LookupValue;
    IF you look at the fieldValue above, you will see it is something like an integer, followed by delimiter ;# and then your template name. you can always just parse the string at the ;# as well if you were so inclined.

  • What is the best, most efficient way to read a .xls File and create a pipe-delimited .csv File?

    What is the best and most efficient way to read a .xls File and create a pipe-delimited .csv File?
    Thanks in advance for your review and am hopeful for a reply.
    ITBobbyP85

    You should have no trouble doing this in SSIS. Simply add a data flow with connection managers to an existing .xls file (excel connection manager) and a new .csv file (flat file). Add a source to the xls and destination to the csv, and set the destination
    csv parameter "delay validation" to true. Use an expression to define the name of the new .csv file.
    In the flat file connection manager, set the column delimiter to the pipe character.

  • I don't have a "create new list" button in the reminder list when i press edit

    I tried to create a new reminder list, I open the reminder app, under Lists, i pressed the 3 bar symbol on the upper right hand corner, then i pressed edit, but there is neither the delete button () nor the  "create new list" button. Can someone tell me how to get the create new list button?

    I had that problem too!
    Do you have a hotmail account that you have connected to?
    Because I do and I couldn't make a new reminder list!!
    But I fixed it by going to settings and going to mail, contacts and calendar and then under "accounts" i went to Mail and then slided the little dot for reminders to off.
    This fixed it for me, hopefully for you too! 

  • I can't create new lists in reminders

    I've recently got an iPhone 4S and I've been trying to add a new list to reminders and edit one of the existing ones but I've been unsuccessful so far. I've followed the instructions from the user's manual and everything seems fine until the very end, I do get to the stage where I can tap the Edit button but then nothing happens when I tap the name of the existing list to edit it. Any ideas how I could resolve this issue are much appreciated! Thanks.

    Hi,
    Thanks for your answer. I can edit the contents just fine, the problem is with creating/editing/deleting lists. Since you mention 'tapping edit then "Create New List"', I think that's where part of the problem lies because I can't create a new list. When I tap 'Edit', I can see my existing (pre-defined) lists but there is no "+" button or a "Create New List" button. I can't tap the lists, nothing happens and no red circle with a horizontal line appears.
    Incidentally, I can't change the names of the pre-defined calendars either but I've sort of managed to bypass that problem by syncing the iPhone with iTunes and importing my calendar from iCal.
    Do you think I should take it back to the shop or is there any other way I could resolve this issue?
    Thanks

  • TS2446 My child wants her own Apple ID for her new phone and mac book. Not sure of steps to disable and creat new account while transferring photos etc. thoughts ?

    My child wants her own Apple ID for her phone and mac book. Not sure of steps to disable and create new account while transferring photos etc. thoughts ?

    Welcome to the Apple Community.
    Unfortunately, if Apple simply allowed people to log into different accounts and download content, everyone would be using everyone could share everyone else's content and bypass the need to purchase anything. To protect against this, they limit you to logging into a new account to once every 90 days.
    If two or more of you, have different accounts and use only one computer, you should each have your own user account on the computer, to avoid the need to log in and out of iTunes.

  • I have a new email address. Changed this on my itunes account. On iPhone deleted old icloud account and created new with new email. I have set find my phone to on. When I download music it no longer goes to icloud an does not show up on my iphone.

    I have a new email address. Changed this on my itunes account. On iPhone deleted old icloud account and created new with new email. I have set find my phone to on. When I download music from itunes it no longer goes to icloud an does not show up on my iphone.

    I have the same problem - it is maddening. I rely on this iPad for work so this is not just an annoyance! The above solutions of changing the appleid on the device or on the website do not work.
    The old email address no longer exists - I haven't used it in a year probably and I no longer have the account.  I logged into the appleid website and there is no trace of the old email address so there is nothing that can be deleted or changed there.  On the iPad there is no trace of the old email address so nothing can be deleted there either. I have updated the iPad software and the same problem comes right back.  Every 2 seconds I am asked to log in using the old non-existent email.  The device is currently useless.
    The only recent change to anything was the addition of an Apple TV device, which was set up using the correct login and password.
    Does anyone have any ideas? The iPad has been backed up to the iCloud so presumably it now won't recognize the current iCloud account? So restoring may notbe an option?

  • Copying home DVD videos, editing, and creating new DVDs

    Here is the situation:
    I have the 17" and this is my first Mac to own. I am computer literate with most my experience on Windows and Linux.
    That being said, I am trying to edit home videos; but they are already on DVDs. I got a LiteOn DVD/VCR combo recorder for my entertainment center. I have a camcorder that uses Hi-8 media and it is only able to use S-video/composite outputs (no USB or Firewire). I am using the LiteOn recorder to archive all my videos to DVDs because it has composite inputs. The LiteON has hardly any editing capability. So I want to take the "simple" DVDs I made, copy them to my HD, edit them (to cut out junk, create better menus, and give it as nice touch), and create new DVDs to distribute to my family and to get rid of old tapes.
    So in short, the process I want to do on the Mac is:
    1. Copy my family home DVDs
    2. Edit the video.
    3. Create more "creative" DVDs for my family.
    I have been looking around the website and reading posts and I don't see how to do this. I did try to create an image on disk utility, but it failed for whatever reason (maybe I am missing a step). How can I accomplish the three steps above?
    Please help.
    Thank you, Michael

    If these are true, standard video DVDs that the drive creates, there are a number of utilities that can extract and convert the videos for use in editing applications. A couple of utilities that people have reported success with are DVDxDV, Cinematize, and MPEG Streamclip (MPEG Streamclip is freeware but requires that you have Apple's QuickTime MPEG2 Playback Component), and there are no doubt others.
    Once extracted, you can use iMovie to edit the clips and iDVD to burn them to a new DVD. Then you can use Disk Image or a third-party application such as Roxio's Popcorn to make additional copies.
    Hope this helps.

  • Transfer assets collectively to new class and create new assets like ABUMN

    We need to change the account determination for a few Asset Classes that already have assets with postings.  As a result we must create new asset classes and assign a new account determination.
    Is there a program that would allow transfer assets collectively to a new asset class and create new assets automatically similar to ABUMN?  T-code ABUMN allows you to transfer multiple assets but you must create the new assets first.  ABUMN will transfer and create new asset but only does one asset at a time. 
    There are hundreds of assets with postings to be transferred from the old asset classes to the corresponding new asset classes.
    Appreciate whatever input you can provide.
    Tara

    download the asset master data(original) and create new asstes using lsmw or any third party tool also.

  • How can I make the popup with empty fileds and create new record?

    I would like to use a popup to create new record.
    I created a af:popup by drag and drop a VO from data control to jsff. then, I created a button and place a af:showPopupBehavior. I was able to popup window by click the button.
    however, the window filled with the information from the 1st record. and when I select a record in table and click popup, the popup is filled with that record.
    How can I make the popup with empty fileds and create new record by saving the popup?
    Thanks

    You can have edit and new buttons, in the PopupFetchEvent identify button source (using popupFetchEvent.getLaunchSourceClientId()) if new button clicked clear the binding using below code.
    If you want to see empty fields, in the popup PopupFetchEvent clear the input component bindings.
    resetBindingValue("#{bindings.<componentid>.inputValue}", null);
        public static void resetBindingValue(String expression, Object newValue) {
            FacesContext ctx = FacesContext.getCurrentInstance();
            Application app = ctx.getApplication();
            ExpressionFactory elFactory = app.getExpressionFactory();
            ELContext elContext = ctx.getELContext();
            ValueExpression valueExp = elFactory.createValueExpression(elContext,expression,Object.class);
            Class bindClass = valueExp.getType(elContext);
            valueExp.setValue(elContext,newValue);
        }

  • Dynamic Action-Delimiting a record and creating new record

    Hi ,
    My requirement is in dynamic Action I need to delimit all records in a Subtype of an Infotype and create New record for these records with BEGDA as ENDDA + 1 of the delimited records.
    Iam able to delimit all records in the Subtype but , Iam not able to create new records.
    My code for delimiting is as given below, in T588Z,
    9901     2          06     801     P     P9901-SUBTY='2'
    9901     2          06     802     P     PSYST-IOPER='MOD'
    9901     2          06     803     P     P9901-STATS='X'
    9901     2          06     804     P     P9901-PREAS='91'
    9901     2          06     805     F     DELIMIT_DTE(ZHSRAS_T588Z_9901)
    9901     2          06     806     W     P9901-ENDDA=RP50D-ZZDATE3
    9901     2          06     807     I     MOD,9901,3
    9901     3          06     808     P     SY-UCOMM='UPD'
    9901     3          06     809     F     DELIMIT_DTE(ZHSRAS_T588Z_9901)
    9901     3          06     810     W     P9901-ENDDA=RP50D-ZZDATE3
    The above code is working fine.
    My code for creating new record is as given below, even though the control is oing to the subroutine, INS statement is not working, and hence new record is not getting created.
    9901     3          06     811     P     SY-UCOMM='UPD'
    9901     3          06     812     P     PSAVE-ENDDA<>P9901-ENDDA
    9901     3          06     813     P     P9901-STATS<>'X'
    9901     3          06     814     I     INS,9901,3
    9901     3          06     815     F     BEGIN_DATE(ZHSRAS_T588Z_9901)
    9901     3          06     816     W     P9901-BEGDA=RP50D-ZZDATE3
    9901     3          06     817     W     P9901-ENDDA='99991231'
    Kindly help me on this.

    Hi shahana,
    1. I have not worked on this dynamic action.
    2. But instead of doing in 2 steps,
       it is usually done in 1 step only, manually.
    3. If we CREATE record from some date,
       then the OLD will AUTOMATICALLY get Delimited.
    (We don't have to do anything specially for delimiting
      the old record)
    regards,
    amit m.

  • Problem in Shrink my local disk C and create new partitions on it.

    I am trying to Shrink my local disk C (current boot volume) and create new partitions on it. But I am getting a Warning message that If I do so, I won't be able to boot from any volume excepet the the current boot Volume. 
    In case if I need to do the recovery for my computer what will happen. does it mean that I can't do the recovery from my hard disk?
    This question was solved.
    View Solution.

    Kaj_R wrote:
    I am trying to Shrink my local disk C (current boot volume) and create new partitions on it. But I am getting a Warning message that If I do so, I won't be able to boot from any volume excepet the the current boot Volume. 
    In case if I need to do the recovery for my computer what will happen. does it mean that I can't do the recovery from my hard disk?
    Hello Kaj_R.
    If you change the volumes it is quite likely that the recovery partition will not function.  I suggest you create a set of Recovery Media before messing with the partitions.
    This document can help you create the recovery media.
    Have a great day!
    Please click the white star under my name to give me Kudos as a way to say "Thanks!"
    Click the "Accept as Solution" button if I resolve your issue.

  • Id email address cancelled. how do I log in and create new password?

    id email address cancelled. how do I log in and create new password?

    This link tells you how to change your Adobe ID and password:
    http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html
    And if it doesn't, there's a "Still Need Help?" link which leads you to web chat where you can talk with a person.

  • What is the diffrence between extends and creating new object?

    HI ALL,
    what is the diffrence between extends and creating new object?
    meaning
    class base{
    class derived extends base{
    class base{
    class derived {
    derived(){
    base var = new base();
    can u people tell me diffence from the above examples.
    THANKS.
    ANANDA

    When you create a new object you have to supply the class to which that
    object belongs. A class can extend from another class. If it does so
    explicitly you can define the 'parent' class from which the class extends.
    If you don't explicitly mention anything, the class will implicitly extend
    from the absolute base class named 'Object'.
    Your example is a bit convoluted: when you create a Derived object,
    its constructor creates another object, i.e. an object from the class from
    which the Derived class extends.
    Extending from a class and creating an object don't have much in common.
    kind regards,
    Jos

  • Reconfigure sales BOM deletes line item and creates new line item

    We are having issue with Sales BOM. Once sales BOM is reconfigure, line item is automatically deleted and creates new line item. These changes are not captured by reporting tool. Is it standard SAP behavior? if its not standard behavior, how to fix this issue?

    Hi,
    If i am not wrong, i assume you are using site instead of plant.   If it is plant , then "yes", we can have a order with same material being line item 10 and 20 with different plants.  Reg delivery, if the plants are configured to a same shipping point then you will have one delievery.  if the plants are configured for a different shipping point , then delivery will be split up.
    Reward if it helps,
    Thanks & regards,
    CLN

Maybe you are looking for