Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

First off, my background is ASP.NET Web Forms. I'm sure this is very simple but I'm quite new to SharePoint. We're running SP Foundation 2010.

I'm going to build a WebPart in VS.NET 2010 and deploy it to our dev server. The WebPart will have stuff like ASP.NET DropDowns and other WebControls as well as using web services and all the nice AJAXy stuff.

What is the standard way to bind data to WebControls when you require access to external data? I thought it might be External Content Types, but I also see there are also Data Sources in SharePoint Designer 2010.

When I add a Data Source in SharePoint Designer, I get an error even though the connection string is correct. I get the generic error "An error occurred while retrieving the list of Databases..."

Any help is greatly appreciated.

share|improve this question

2 Answers 2

Both External Content Types (to be precise, ECT is only a part of BCS - Business Connectivity Services) and DataSources (you can create them programmatically, not only through the SharePoint Designer) - can be used to connect external data to SharePoint.

I'd prefer to use BCS when dealing with important external data. In long perspective, this approach offers plenty of benefits. BCS is flexible, it is integrated with SharePoint Search, it distinguishes user privilegies, it can be highly customized with XML schemas, you can retrive the data programmatically, and also BCS supports almost the same look and feel (and functionality) for the data, as ordinary SharePoint lists. You can find BCS detailed overview, how-tos, walkthroughs and other documentation on MSDN.

For secondary data - DataSources approach could appear to be faster and flexible enough in most of circumstances. This way, you should connect your DataSource with a DataViewWebPart, and use XSL transformations to customize the appearance of the data. Keep in mind, that SharePoint XSLT is exceedingly extended, has many extension functions and ready-to-use code. DataViewWebPart is a very flexible and powerful OOTB webpart, which is entirely integrated with all other SharePoint webparts (for example, it can be connected with Filter webparts, can use ParameterBindings, etc.).

Also, there are some other ways to fetch external data and display it in SharePoint:

  • Use custom classes and webparts for retrieving and displaying data. Not a recommended way, because in that case you don't have any integration with SharePoint at all. Could be chosen, if you have a ready ASP.Net code for displaying and retrieving the data, and you don't anticipate any need of further integration with SharePoint (for example, using site-scoped search, etc.).
  • use SQL Server Integration Services (SSIS) in conjunction with SharePoint List Source and Destination adapters from OpenSource project Microsoft SQL Server Community Samples: Integration Services to syncronize your external data with an ordinary SharePoint list (actually, BCS pretends to do the same, however, External Lists still have many significant limitations). This approach is described on MSDN. A very promising solution, but you will need SSIS installed.

Drawing a line: I'd recommend you to investigate these approaches intently, and maybe eventually you will decide to refuse standard ASP.Net controls and common ASP.Net way to attain your objectives. I anticipate, that actually you can achieve the same result without creating a single custom webpart, and maybe even without writing any custom C#-code :) And the no-code solution could turn out to be much more flexible, than code one.

share|improve this answer
    
So if I want to make a form in SharePoint with picklists and stuff like this, jsfiddle.net/nickyt/RErS7, I can do this in SharePoint without InfoPath/form services (SharePoint Foundation doesn't come with these) easily and bind the controls to external data via external content types even though the external content types are bound to a SharePoint list? BTW, I never got the data source working. It kept complaining about an invalid connection string even though it was correct. I see there are lots of blog posts about it. Maybe it's SharePoint's way of discouraging it's use? ;) –  nickytonline Oct 6 '11 at 18:03
    
1) External lists provide ability to design their forms using XSLT. In XSLT you can use any ASP.Net and SharePoint controls for displaying or editing your data (yes, as I mentioned above, SharePoint XSLT has many extensions). So basically, you can customise your form design exceedingly. This will need some time for investigations of course, but I reckon, it's worth it. 2) I'm using DataSources and they work well. Maybe you have some particular issue with that, so I'd recommend you to post a detached question here on SharePoint SE and provide detailed information and the code you're using. –  Andrey Markeev Oct 6 '11 at 23:23

omin has given you lots of aternative I think since you are new to SP you should be able to connect to SQL server or even Oracle using Sharepoint Designer. If you want sharepoint to know your data then just use SharePoint List Source and Destination adapters but you will need SSIS and probably you will steiil have to use Sharepoint designer to design the page. Hope this helps

share|improve this answer
1  
To be precise, connecting to Oracle is a bit tricky, you will need to edit BCS schema xml, as it is described on MSDN: msdn.microsoft.com/en-us/library/ff464424.aspx –  Andrey Markeev Oct 6 '11 at 23:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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