Monday, July 03, 2006

.Net: You don't know the power of the dark side

Visual Studio isn't yet on our computers at work, so I opted to try out the sharpdevelop/web matrix combination by reimplementing one of our simpler, existing Java portlets. The portlet was display-only: get user data and show it. No pagination in this case, or viewing options of any kind. No postback whatsoever.

Wading through reference material and examples, I got a rough but working version done much faster than I had expected. The compiler type checks and editor code completion (the corresponding Sith term is intellisense) came in handy here, in the worst case at least allowing for faster typo-free typing. There were only a handful of controls on the web form, so I can't claim to have truly tested web matrix. I can see how it could get tedious trying to keep the control declarations synchronized between the aspx in web matrix and the code behind in sharpdevelop...from what I read, visual studio does that task for you.

The biggest hurdle was getting the database access working, of course. The .Net provider installed without any trouble, but when I tried a 'using', my combine failed to build. A quick web search showed the newbie that one must go to the project tab, right click on references, and add the assembly reference before 'using'. It's even in SD's FAQ. After that, I moved on to getting the connection string exactly right. And finally, figuring out which methods on which objects in which combinations in order to execute a few queries. For my first attempt to display the data, I used a custom grid control that happened to be in the example I was following. It worked in a way that felt a bit kludgy, but then I noticed that the custom control was a subclass of DataGrid. I switched to using a vanilla DataGrid for the sake of standardization. Suddenly I was able to precisely define the columns of my DataGrid within the web matrix GUI. After looking up what else my asp.net training book had to say about DataGrid, I'm feeling excited. I hope Java doesn't have a custom data table-generating tag with DataGrid's combination of flexiblity and ease, because if it does then I had been working much harder than I had to.

My initial foray into .Net development has remained positive. I am getting the impression that even as I learn, I still do not know on a palpable level the power of the dark side.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.