How to insert excel sheet data into sharepoint using vb.net or c# windows application

Murari Ram 21 Reputation points
2021-01-13T18:02:05.337+00:00

Hi All,
I want to design windows application and it needs to support to dump excel sheet records into share point using vb.net or c# windows application. Please guide me on this.

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,301 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,685 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Erin Ding-MSFT 4,456 Reputation points
    2021-01-14T07:05:56.917+00:00

    @Murari Ram

    Tag “office-online-server-sharepoint” focuses on technical questions about integrating Office Online Server with SharePoint Server.
    Since your issue is more related to SharePoint development which is out of our scope of support.
    I would modify the tag to be “sharepoint-apps-general-dev”.
    Thanks for your understanding.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Amos Wu-MSFT 4,051 Reputation points
    2021-01-18T06:27:39.613+00:00

    Hi @Murari Ram ,
    You could try to use SSOM or CSOM.
    My test SSOM code for your reference(SSOM can only be used for SharePoint Server):

        String fileToUpload = @"C:\Users\Administrator.CONTOSO\Desktop\workflowList.csv";  
        String sharePointSite = "http://sp";  
        String documentLibraryName = "Shared Documents";  
    
        using (SPSite oSite = new SPSite(sharePointSite))  
        {  
            using (SPWeb oWeb = oSite.OpenWeb())  
            {  
                if (!System.IO.File.Exists(fileToUpload))  
                    throw new FileNotFoundException("File not found.", fileToUpload);  
    
                SPFolder myLibrary = oWeb.Folders[documentLibraryName];  
    
                // Prepare to upload  
                Boolean replaceExistingFiles = true;  
                String fileName = System.IO.Path.GetFileName(fileToUpload);  
                FileStream fileStream = File.OpenRead(fileToUpload);  
    
                // Upload document  
                SPFile spfile = myLibrary.Files.Add(fileName, fileStream, replaceExistingFiles);  
    
                // Commit   
                myLibrary.Update();  
            }  
        }  
    

    More threads for your reference:

    1. How to: Upload a File to a SharePoint Site from a Local Folder
    2. Upload A Document To A SharePoint 2013 Library Using Client Side Object Model

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.