Posts in Category: Development

Upgrading from ByteFX to the .NET Connector for MySQL

Last night I made the switch from the older ByteFX Data provider for MySQL to the newer  .NET Connector for MySQL.  It required some code changes in the MySQL data layer. 

For Example, anywhere I was using parameters like @SiteID, they had to be changed to ?SiteID except in places where the parameter is not being passed in but used in SQL with a SET statement .

In this line:
SET @PageLowerBound = (?PageSize * ?PageNumber) - ?PageSize

?PageSize and ?PageNumber are passed in but @PageLowerBound is not and it wouldn't work if I used ? instead of @

Another difference is in ByteFx you have only one data type for int MySqlDbType.Int whereas in the newer .NET Connector you have MySqlDbType.Int16, MySqlDbType.Int24, MySqlDbType.Int32, and MySqlDbType.Int64 and it won't work with just MySqlDbType.Int so you have to change the code.

I wasn't having any problems with the ByteFX provider myself but a few people have posted in the forums and been unable to connect using ByteFX with their specific version of MySQL. One person tried switching to the .NET Connector and then was able to connect but of course without the code changes described above it did not work for him either.  Hopefully this change will eliminate any problems some users were having with the MySQL version of mojoPortal.  It will be included in tomorrow's release.

Another user reported problems with losing special characters when data was saved to the database.  He was working with Portuguese content and it worked correctly in Text fields populated using the FCKeditor but did not work correctly with VarChar fields populated using normal text boxes.  I don't know if this change will fix that problem but I hope so.

Other gotchas I have observed with ByteFX and .NET Connector when building on Windows and deploying on mono you get the dreaded "File Not Found error" which would more accurately be described as "Couldn't load assembly".  This is caused because these data providers are shipped with a pre-comiled version of sharpziplib that was built using incremental build.  This problem is easily overcome by obtaining the source code for sharpziplib and compiling it myself with full Re-Build.  By doing this I have no problems compiling on Windows with VS.NET and deploying on mono.

Anonymous SVN Checkout now available

I am happy to announce that the mojoPortal source code is now available using anonymous checkout from a Subversion source control repository hosted on See the Download page for details.

Big Thanks to Novell for making this service available free to the open source community!

Data Loss is a drag

In my rush to prepare for my presentation at the .NET user group I made a major bad move. Ouch!  I have 2 linux machines setup with MySQL and the one that was hosting the data for the mojoPortal web site was also the one I wanted to bring to demo mono. So I thought I'd copy the data to another machine and just point the site at that until I'm done with my presentation. Both machines already had a mojoportal database so I went to delete the one on the target machine so I could copy it over fresh but in a true Homer moment I deleted the wrong one. I had a backup but its about a week and half old so I lost some recent blog comments, forum posts and some major documentation work I did last weekend. Yes I know better, thats why it hurts so much. I let my guard down because my production machines are also development machines.

Anyway I'm all set for the meeting and none of the lost data has any financial impact, just frustration factor. I do have the names of everyone who requested one of the dvds I'll be giving away.

I appologize to Troels for losing his post in the bug forums.

Database Paging continued

I've updated my previous post with the actual implementation after testing and tweaking. The stored procedure for paging through threads in a forum from newest to oldest is quite different than my original post. The paging through posts in a thread is more like my original idea because it pages from oldest to newest. The forums are coming along nicely now. Once I finish with the MS SQL implementation it will be only a little extra work to get the MySQL version working so I can show it off on this site. This site is using MySQL but on my development machine I switch back and forth between the the 2 data layers as needed.

New Skin

This skin only took about 20 minutes to create. When I have time I'll do something more elaborate. For the moment I'm much more focused on functionality than making it pretty. I envision being able to create tools within the site that will allow creation of skins using the web browser. Other features need to be done first. I'd like to have the photo gallery and forums modules ready before I make a release, particularly the forums because then if people find bugs they can post to the forum instead of sending me an e-mail and I can avoid having to answer the same questions to multiple users.