Data Sources in
SharePoint 2010
Kathy Hughes
SharePoint Server MVP
Sydney, Australia



                        Kathy Hugh...
SharePoint Designer 2010
Unleashed book
• http://www.amazon.com/SharePoint-Designer-Unleashed-
  Kathy-
  Hughes/dp/067233...
Tonight
• New data source features
• Differences between 2007 and 2010
• Data Source Configuration Options in SharePoint D...
SharePoint Conference 2011
• www.sharepointconference.com.au
• Sydney, Australia, Hilton Hotel, March 8 and 9, 2011

• www...
SharePoint 2010 Big Picture
• Data Sources extend to include:
• Integration with server-side and client-side OM
• Data Sou...
Enter SharePoint Designer!
• SharePoint Designer 2010
• Hugely improved UI for working with SharePoint Sites
• Extensible ...
Deprecated Features
• Things that have been removed in SharePoint Designer 2010

  • Can no longer attach other sites with...
What’s New?
• REST’ful Web Services
  • Connect to SharePoint lists
  • Powerful filtering, down to item level
• External ...
Supported Data Sources
•   SOAP/XML Web Services
•   XML Files
•   REST Web Services – NEW (aka Server-side scripts)
•   D...
What About the BDC?
• Replaced by External Content Types
• Business Connectivity Services
• Create database connections, ....
Data Source UI Compare




                         Kathy Hughes
REST’ful queries
• New to SharePoint 2010
  • Client-side API
• Flexible queries, down to the list item
• Query Excel Spre...
REST APIs

              Client OM



Farm   Site    List Data   External Lists




                                      ...
REST Requirements
• Windows Server 2008 R2 (WFE) or Windows 7
  • ADO.NET Data Services Update for .NET 3.5 SP1
     • Or
...
REST APIs
• Syntax
• /_vti_bin/ListData.svc/{Entity}[({identifier})]/[{Property}]

• Example to get the Tasks list

• /_vt...
REST’ful Response




                    Kathy Hughes
Validate REST URL First
• In browser is a great way
• However, don’t forget to disable your feed formatting

• DEMO – disa...
REST APIs
• QueryString Parameters

•   $filter=(simple predicate}
•   $expand={Entity}
•   $orderby={property}
•   $skip=...
Sample Queries
• $filter=(simple predicate}
• http://tonka/_vti_bin/listdata.svc/Tasks?$filter=Title eq
  'Fourth Task'

•...
REST Configuration in SPD




                            Kathy Hughes
Authentication
  • Anonymous – site and content must be set to anon
  • Windows Integrated – doesn’t work for non-authenti...
Tasks list back in SharePoint




                            Kathy Hughes
DEMO
• Querying with REST from SharePoint Designer 2010
  • Configure connection in SharePoint Designer
  • Add to page us...
REST in InfoPath
• InfoPath story has changed significantly in SharePoint Server
  2010
  • We can now replace our list fo...
Example of REST in InfoPath




                          Kathy Hughes
Troubleshooting Data Sources
• What can go wrong? Some things…
  • Authentication
     •   NTLM or Kerberos?
     •   Sing...
…And, we don’t like to see…




                          Kathy Hughes
Troubleshooting
• Database connections don’t allow Windows authentication
  • asp:SqlDataConnection




                  ...
How to Debug
• Database connections
  • In SharePoint Designer
     • fpdatasource folder, which is located under the site...
SQL Server Profiler Trace




                            Kathy Hughes
DEMO
• Working with database connections , SQL 2005 or 2008, and
  custom database schemas
• *Custom schema is currently b...
Check the Database Schema




                        Kathy Hughes
What to use when?
• If you need to do x-site/site collection queries then use SOAP
  or RSS
• If you want to add a databas...
DEMO

• Remember we no longer have the option to ‘attach’ list from
  another site
• Instead, we can use SOAP to access x-...
Upcoming SlideShare
Loading in …5
×

Data sources in share point 2010

14,567 views

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
14,567
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Data sources in share point 2010

  1. 1. Data Sources in SharePoint 2010 Kathy Hughes SharePoint Server MVP Sydney, Australia Kathy Hughes
  2. 2. SharePoint Designer 2010 Unleashed book • http://www.amazon.com/SharePoint-Designer-Unleashed- Kathy- Hughes/dp/0672331055/ref=sr_1_3?s=books&ie=UTF8&qid= 1295312377&sr=1-3 Kathy Hughes
  3. 3. Tonight • New data source features • Differences between 2007 and 2010 • Data Source Configuration Options in SharePoint Designer 2010 • Check out REST’ful data connections • Debugging data sources • Consuming data sources in a SharePoint site Kathy Hughes
  4. 4. SharePoint Conference 2011 • www.sharepointconference.com.au • Sydney, Australia, Hilton Hotel, March 8 and 9, 2011 • www.sharepointconference.co.nz • Wellington, New Zealand, March 16 and 17, 2011 Kathy Hughes
  5. 5. SharePoint 2010 Big Picture • Data Sources extend to include: • Integration with server-side and client-side OM • Data Source configuration options in SharePoint Designer 2010 • Data Views • Great alternative for standalone SharePoint Foundation 2010 • SharePoint Server 2010 = extensive opportunites • Access Services – NEW to 2010 • Visio Services – NEW to 2010 • Excel Services - Improved • PerformancePoint Services (SSAS) - improved • InfoPath Services – improved, richer interface and options • Client-side • Access, Excel, Visio, InfoPath (Designer) Kathy Hughes
  6. 6. Enter SharePoint Designer! • SharePoint Designer 2010 • Hugely improved UI for working with SharePoint Sites • Extensible customization • Pages • Data • Workflows • Branding • Plus, more… • Ease of use • Code-free! • XSLT and XML friendly tools and intellisense Kathy Hughes
  7. 7. Deprecated Features • Things that have been removed in SharePoint Designer 2010 • Can no longer attach other sites within a site collection • Too many security issues • Use RSS or SOAP instead • No more BDC under Data Sources • Replaced by External Content Types (BCS) • No more dependency on application definition files! Kathy Hughes
  8. 8. What’s New? • REST’ful Web Services • Connect to SharePoint lists • Powerful filtering, down to item level • External Content Types (AKA BDC) • Now under External Content Types • More powerful integration, wizard-driven CRUD operations • SQL, WCF and .NET types Kathy Hughes
  9. 9. Supported Data Sources • SOAP/XML Web Services • XML Files • REST Web Services – NEW (aka Server-side scripts) • Database Connection • Linked Data Sources Kathy Hughes
  10. 10. What About the BDC? • Replaced by External Content Types • Business Connectivity Services • Create database connections, .NET type connections, Web Service Connections • Create create, read, update and delete (CRUD) actions • Built in wizards • Code – free • Integrate with Office applications • Add external customer list into Outlook Contacts! • Greater authentication options • Secure ID • Kerberos / impersonation Kathy Hughes
  11. 11. Data Source UI Compare Kathy Hughes
  12. 12. REST’ful queries • New to SharePoint 2010 • Client-side API • Flexible queries, down to the list item • Query Excel Spreadsheets (Services) with REST • Down to the cell • Another option for sourcing data x-site collections • Connector available in SharePoint Designer 2010 • It works! Kathy Hughes
  13. 13. REST APIs Client OM Farm Site List Data External Lists Kathy Hughes
  14. 14. REST Requirements • Windows Server 2008 R2 (WFE) or Windows 7 • ADO.NET Data Services Update for .NET 3.5 SP1 • Or • ASP.NET 4.0 framework • SharePoint Designer 2010 • Configure and display REST connections • Data View Web Part • Visual Studio 2010 • Greater flexibility Kathy Hughes
  15. 15. REST APIs • Syntax • /_vti_bin/ListData.svc/{Entity}[({identifier})]/[{Property}] • Example to get the Tasks list • /_vti_bin/ListData.svc/Tasks • Returns all Tasks in the designated site • *If the URL returns XML then the service is working… Kathy Hughes
  16. 16. REST’ful Response Kathy Hughes
  17. 17. Validate REST URL First • In browser is a great way • However, don’t forget to disable your feed formatting • DEMO – disable feed formatter in IE • See http://www.youtube.com/watch?v=ap1XZd1huP8 Kathy Hughes
  18. 18. REST APIs • QueryString Parameters • $filter=(simple predicate} • $expand={Entity} • $orderby={property} • $skip=n • $top=n • $metadata • See http://msdn.microsoft.com/en-us/library/cc907912.aspx Kathy Hughes
  19. 19. Sample Queries • $filter=(simple predicate} • http://tonka/_vti_bin/listdata.svc/Tasks?$filter=Title eq 'Fourth Task' • $orderby={property} • http://tonka/_vti_bin/listdata.svc/Tasks?$orderby=Title desc • http://tonka/_vti_bin/listdata.svc/Tasks?$orderby=Title asc Kathy Hughes
  20. 20. REST Configuration in SPD Kathy Hughes
  21. 21. Authentication • Anonymous – site and content must be set to anon • Windows Integrated – doesn’t work for non-authenticated clients, i.e. clients in separate domain – NTLM vs Kerberos • Clear / basic – non-secure, consider, and test with, SSL <DataSources> <SharePoint:XmlUrlDataSource runat="server" id="Tasks2" AuthType="Basic" HttpMethod="GET" InsertCommand="http://tonka/_vti_bin/ listdata.svc/Tasks" AuthUserName="kathyhughesadministrator" AuthPassword=“pword" selectcommand="http://tonka/_vti_bin/listdata.svc/Tasks"/> </DataSources> Kathy Hughes
  22. 22. Tasks list back in SharePoint Kathy Hughes
  23. 23. DEMO • Querying with REST from SharePoint Designer 2010 • Configure connection in SharePoint Designer • Add to page using a Data View Web Part • http://www.youtube.com/watch?v=gTo6JTVnhkU Kathy Hughes
  24. 24. REST in InfoPath • InfoPath story has changed significantly in SharePoint Server 2010 • We can now replace our list forms with InfoPath forms • We can add lookups, rules and queries back to other lists in SharePoint • We can consume existing REST data connections! Kathy Hughes
  25. 25. Example of REST in InfoPath Kathy Hughes
  26. 26. Troubleshooting Data Sources • What can go wrong? Some things… • Authentication • NTLM or Kerberos? • Single, multiple, non-domain members • Clear text/SSL, • SSO only available with SharePoint Server 2010 (same as 2007) • Database schema mismatch • SharePoint Designer database connection wizard does not understand custom schema, e.g. • Sees SELECT * FROM [Product] rather than SELECT * FROM [Production].[Product] • Query fails • XML and REST Web Services • Be aware that list names ARE case sensitive • i.e. Tasks needs Tasks in the URL parameter and query parameters Kathy Hughes
  27. 27. …And, we don’t like to see… Kathy Hughes
  28. 28. Troubleshooting • Database connections don’t allow Windows authentication • asp:SqlDataConnection Kathy Hughes
  29. 29. How to Debug • Database connections • In SharePoint Designer • fpdatasource folder, which is located under the site’s _catalog’s folder • Check and directly edit the XML • On the SQL Server • Check the logs • Use the SQL Server Profiler • Set up custom ‘profile’ templates to trap errors when accessing tables, etc • Authentication • On the SQL Server • Use the SQL Server Profiler • Trace logins against databases • ‘GUEST’ login is found to be a common error Kathy Hughes
  30. 30. SQL Server Profiler Trace Kathy Hughes
  31. 31. DEMO • Working with database connections , SQL 2005 or 2008, and custom database schemas • *Custom schema is currently broken in Beta 2 • i.e. entering custom SQL statements fail to ‘hold’ database schema • AdventureWorksDW works because it has the default database schema of DBO. • IMPORTANT: if using SharePoint Server 2007 or 2010 you have the option of using SSO • See http://www.youtube.com/watch?v=pK_NcAstyis Kathy Hughes
  32. 32. Check the Database Schema Kathy Hughes
  33. 33. What to use when? • If you need to do x-site/site collection queries then use SOAP or RSS • If you want to add a database connection for the ENTIRE site, then use the Data Source Database Connector • If you want to add a database connection for a single page, either: • Leverage an existing site database connection • OR • Add a new connection via the Toolbox > ASP.NET Controls > SqlDataSource and use the GridView control to display the data Kathy Hughes
  34. 34. DEMO • Remember we no longer have the option to ‘attach’ list from another site • Instead, we can use SOAP to access x-site data • Use the XML Web Service to access list data from other sites • See http://www.youtube.com/watch?v=QyGdbRv954E Kathy Hughes

×