NBusiness v2.0 Released!

After working for over a year on this project I have finally achieved my original goals! It’s been a long and intense year of coding for me and I’ve loved every second of it. I still have some major features ahead of me and (no doubt) lots of debugging still but I have managed to produce something that I feel is pretty good quality and will be beneficial to everyone that uses it.

Download NBusiness v2.0 here.

Of course there are still some known issues to work out and plenty of room for improvement in the entity authoring experience, especially as it relates to intellisense in the C#/VB code beside. I’m not sure how to fix this though I have looked into it some already but I can say that it’s a top priority here.

When releasing this build I had to decide whether or not I should release an “imperfect” build or delay it longer but fix all of the issues I was seeing. If this was a commercial project I probably would have tried to work out more of the issues first but since it is (mostly) only me I felt it wasn’t worth delaying things much longer, since I can only do so much so fast. However, most of the known issues are annoyances and not critical show stoppers anyway. Despite these few remaining problems I’m very happy with this release and find myself wanting to use it with any new project. In fact it’s hard to imagine doing it any other way at this point!

Here is a screen shot of NBusiness integrated into Visual Studio (click to view fullsize):

I’m going to try to make some screen casts pretty soon too. I have never really done that before but I think a couple simple screen casts would be pretty helpful for people.

And please everyone, let’s make use of the forums and work items on codeplex!

Mapping Sql Types to .NET Types

I bet there is an article out there somewhere that tells you exactly what .NET Types to use with the corresponding SQL column types but I couldn’t find it anywhere. After scanning for a few minutes I decided to just write something up that tells me definitively what Type to use.
In this case I needed it because I had a bug in NBusiness whith the mapping to the double. After changing the Type a few times I couldn’t figure out what Type to actually map to a double. So I created a table that has one column of each type and I used a simple SqlDataReader to figure out the .NET Type of the field.
I created a simple type mapper just to show me what I wanted. And here are the results:
Sql Type .NET Type
bigint long
binary byte[]
bit bool
char string
datetime DateTime
decimal decimal
float double
int int
money decimal
nchar string
ntext string
nvarchar string
real single
smalldatetime DateTime
smallint short
smallmoney decimal
sql_variant object
text string
tinestamp byte[]
tinyint byte
uniqueidentifier Guid
varbinary byte[]
xml string

Godaddy and HttpModule Problems

I just had an issue rolling out an HttpModule to my godaddy site (this site). I have a custom URL rewriter that I use to convert urls for blogs and topics by title into a common handler. For example the path:
Will actually just be routed to the URL:
It’s prettier that way and then I only need one page to serve up all of the blogs BUT I had some major problems rolling it out. I had no idea why though, it worked great on my test site but then I rolled it out to Godaddy and it just didn’t work. So I did what any other developer would do and I search Google high and low for about an hour. After a while I finally found a tidbit related to the default file for a given site and how if it was, say, index.html than if you had url’s that didn’t specifically have an .aspx on the end then IIS wouldn’t even try to use ASP.NET but would instead just try to serve up the raw pages! This is what I was doing and once I added the .aspx to the above URL’s and my rewriter then suddenly it worked, the server would hook into my custom URL rewriting HttpModule and everything was dandy!

Simple Silverlight Image Gallery

    So, here is a simple example of how to do a data driven image gallery using silverlight. The overview is that an image will be stretched across a Rectangle to display our images. Our image gallery control will call back to a webservice hosted by our webserver to get URLs to subsequent images in the gallery. This is a pretty basic example and could easily be extended to have more interesting logic for getting images (flickr maybe or an image in a sharepoint image gallery for example) since we’re simply using the raw URL to the image to display it.
    To get all of this working you will need to be sure you have the asp.net futures stuff installed and you create an asp ajax futures project for your website. Then you create your silverlight project and create a “link” back to the silverlight project. For those of you not in the know this is a new thing Microsoft cooked up special for Silverlight. It’s similar to a reference but it pulls in the assemblies to the ClientBin rather than the Bin as well as pulling in the Page.xaml necessary to get it going with IIS. You’ll need to either use javascript or an tag to get it working.
    On the client side we have an HtmlTimer class to tell us when it is time to get a new picture. During initialization we will get a list of all of the images (you could just as easily query the service for only the next image) using the standard web service proxy class created by adding a webreference in our silverlight probject. On the Tick handler we will use the URL to the image to fill the rectangle.