Thursday, June 19, 2008

DataView in SharePoint Designer

If you got the following error when browsing the page created in SharePoint Designer with a DataView

Cannot convert type 'Microsoft.SharePoint.WebControls.SPSqlDataSource' to 'System.Web.UI.IAttributeAccessor'

You will need to check whether the DataFormWebPart is created within a webpart Zone.

The solution would be insert the webpart zone first and then insert the dataview webpart within it.

Tip: when you insert webpart zone or dataview, you will need to high light the area you want to insert in the Design view in SharePoint Designer.