简体   繁体   中英

How to : Visual Studio 2010 create Sharepoint List and define data source?

I have this ugly requirement of creating a SharePoint list (could be a custom or an calendar) which displays the companies upcoming events, the problem is that x department updates an excel sheet weekly which would be the data source to this SharePoint List.

And requirement also include allowing users to "Connect to outlook" option enabled.

From my very limited experience with SharePoint I believe that I should create the SharePoint list in Visual Studio(2010) which I am not sure about how to do and later use odbc to connect to the excel sheet to use as a data source.

I am not sure if its possible to define a data source to a list.

Please point me to the right direction and help me with tutorials.

Thanks a lot in advance.

Regards, Vishal

You should define the list in Visual Studio project and some functionality to import data into the list from Excel file.

Defining list in Visual Studio is quite simple and well documented action.

There can be several ways to import content of Excel file into the list.

I did this as general functionality by defining SharePoint custom action (Ribbon button) and application page. In the application page is upload control for uloading excel file. After upload I use ODBC to access content of Excel. Beware that using ODBC needs Excel file to be saved to disk on server side as ODBC requires disk file.

Other option is to create document library and associated Event receiver that will handle ItemAdded event and do the same as in previous point.

To access content of Excel file you may use OpenXML SDK but it is limited to XLSX format (Excel 2007+ format). Advantage is that you do not need to save the file to disk.

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