HTTPModules and SharePoint 2010

July 1, 2010 at 8:58 am

Right now I am spending my time migrating SharePoint Apps from 2007 to 2010.  Today I had an quite interesting problem with the httpmodules. On the SP2007 server we placed them in the web.config under the httpmodules section.

This did’nt work in 2010. So I tried to place them under system.webserver – modules and that worked :-) .

First problem solved for the day.

Please let me know if somebody experienced the same.

SharePoint Designer, MySql and the DataView WebPart

March 19, 2010 at 10:53 am

My topic for today is displaying data from a MySql database in a DataView Webpart.

Seemed like a straight forward task. So I installed the newest ODBC drivers and added a new ODBC database connection to SharePoint Designer using the following connection string:

DRIVER={MySQL ODBC 5.1 Driver}; SERVER=192.168.114.101; DATABASE=test;UID=user; PWD=password; OPTION=3

And I ended up with this error message:

I checked the connection string, but I couldn’t find an error.

So since this didn’t work out, I tried a differend approach. I configured an asp.net SqlDataSource control like this:

<asp:SqlDataSource runat=”server” id=”SqlDataSource1″ ProviderName=”System.Data.Odbc” ConnectionString=”Driver={MySQL ODBC 5.1 Driver}; server=192.168.114.101;database=test; uid=username; pwd=password; option=3″ SelectCommand=”select testcol,testcol2 from test”>
</asp:SqlDataSource>

You will find that control on the Toolbox in SharePoint Designer. There is also a wizard that helps you configure your datasource.

The next step was to add a DataView Webpart and set it’s DataSourceId to my SqlDataSource:

<WebPartPages:DataFormWebPart DataSourceID=”SqlDataSource1″ runat=”server” …

So it looked like this:

From here it is pretty straight forward. Press that link and drag and drop your columns on to the webpart.

That’s it:

Oh no, hang on, what’s that? There is an error!

I have seen that before. I (or the SharePoint Designer) accidently added a second blank DataView Webpart. So I removed that webpart from the source view and everthing worked fine.