0

I'm new in MVC ASP.NET web app develop, I created an MVC WebApp hosted in AZURE App Service that CRUD into my SQL Azure Database. I used Visual Studio 2017 to do it, and it works great, it was relative easy to understand and it was helpful read the many walktrough found in stackoverflow or msdn sites. Now I'm engaged with a new develop of my web app. I would like to create a form in wich I can write on my sales SQLtable a myID of a sharepoint doc list, here's a diagram, I tried everything found on web but I don't understand how and where I can call teh sharepoint site list. In my web app there is Authentication Azure Active Directory as connected service and I would like to use CSOM or Microsoft Graph to do it. Many many thanks only to have read this message bye enter image description here

1 Answer 1

0

You cannot directly query the SQL tables in SharePoint Online. You can use the SharePoint REST API.

If you want the ID of the library:

https://yourserver/sites/yourSite/_api/web/lists/getbytitle('Documents')?$select=Id

Set the method to GET and the headers for if you want XML or JSON. For JSON:

{"accept": "application/json; odata=verbose"}

If you want the ID for a document:

https://yourserver/sites/yourSite/_api/web/lists/getbytitle('Documents')/Items?$filter=FileLeafRef eq 'AdventureWorksBikes.xlsx'&$select=Id

For both of the above, you will need to deal with authentication. Do a web search for "SharePoint Online REST authentication".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.