Geeks With Blogs
Will Smith The Blog in Black C#
IEnumerable<T> Serialization
I ran into the same old "cannot serialize value myType of type myType" issue the other day and knew immediately that I should check that my classes were marked with the [Serializable] attribute. Well, I checked and all of the classes had the attribute as required. So I spent an hour our so searching the web for other reasons why we might get this error. I found nothing. So I pinged a buddy of mine and I walked him through the issue. He said, "It's gotta be one of your classes missing the Serializable ......

Posted On Wednesday, January 21, 2009 1:20 PM

PageMethods Article
I've had a few comments to my PageMethods blog from about a month ago. They were all along the lines of "not enough code." I wasn't really intending to provide a detailed account of my experience, but to exclaim how cool PageMethods are (at least for my scenario). Well, I am hoping to put some time aside over the next week or two to write a brief article on the subject. I'll be sure to include all of the code and hope to go through each step of the relatively short process. By the way, if anyone ......

Posted On Wednesday, January 7, 2009 11:06 PM

.Net Casting using Reflection
Recently, I ran into a problem where I needed to cast from an unknown type to a known type. Normally this would be fine as I a generic cast. For example... 1 public static T ValueOf<T>( this OracleCommand command, string parameterName ) 2 { 3 return (T)command.Parameters[param... 4 } The parameter of course returns an object and I wanted to streamline the parameter value lookup process. All was well until I started using ODP.Net (instead of Microsofts OracleClient). With the OracleClient, ......

Posted On Thursday, December 4, 2008 8:03 AM

ASP.Net WebParts and Oracle
So I was hoping this post would be a glorious review of my first attempt at working with WebParts and Oracle. Alas, the experience has not been so glorious. I am working on a "dashboard" of sorts as a demo for my boss. I spent a few hours on it this afternoon as a spike to see if the approach is feasible. I have to say that I believe it is, but there is one major kink I have to work out. ASP.Net WebParts uses the SqlPersonalizationProvider by default. Unfortunately, we are developing on Oracle. However, ......

Posted On Friday, November 21, 2008 12:06 AM

Custom GridView Guidelines - Part 4 - Wrap Up
Introduction Last time we spent a lot of time on the SelectionController. To conclude the series, we will hook the selection behavior into our CustomGridView. Recap: Custom GridView Guidelines - Preface Custom GridView Guidelines - Part 1 - Preparing the Canvas Custom GridView Guidelines - Part 2 - Selection Interface Custom GridView Guidelines - Part 3 - SelectionController Implementing the IRowSelectionView There are quite a few events on the view that the CustomGridView needs to implement. In ......

Posted On Friday, November 14, 2008 8:07 PM

Custom GridView Guidelines - Part 3 - SelectionController
Introduction This part in the series will focus on the SelectionController. Here is where most of the work is done. We've already covered the view interface, IRowSelectionView. Now we will see how the controller interacts with the view. Recap: Custom GridView Guidelines - Preface Custom GridView Guidelines - Part 1 - Preparing the Canvas Custom GridView Guidelines - Part 2 - Selection Interface Capturing Shift and Ctrl Key Status We want to emulate multi-selection as in Windows Explorer. The Shift ......

Posted On Tuesday, November 11, 2008 11:52 PM

Custom GridView Guidelines - Part 2 - Selection Interface
Introduction I briefly described the design approach in Part 1. This part in the series will explore the ways in which the custom GridView communicates to the controller. I extend my apologies for the lack of code. I am limited in what I can provide. I hope that these guidelines will help point you in the right direction. Classes / Interfaces CustomGridView - The GridView we are customizing SelectionController - Responsible for the row selection behavior IRowSelectionView - How CustomGridView and ......

Posted On Thursday, November 6, 2008 1:33 AM

Custom GridView Guidelines - Part 1 - Preparing the Canvas
Background Way back in March I posted about a custom GridView I was working on. Then in June, I said that I would be posting some guidelines "in the coming weeks". Needless to say, I've been busy with other things. I am hoping to provide some basic guidelines on how to customize a ASP.Net GridView. I am no expert. The experts build components for retail use. Also, I've taken a server-side approach to the problem which is perhaps a little outdated with AJAX technology available. In my case, I use ......

Posted On Thursday, November 6, 2008 12:47 AM

Testing OracleException
In the application I've been working on, we have the requirement to handle unique constraint errors gracefully. It wasn't really hard, I just had to check for OracleException.Code == 1. The trick was the testing. Testing a unique constraint error was not a problem. The issue is verifying that other exceptions are bubbled up properly. The basic exception handling code is like this: 1 protected bool HasUniqueConstraintError( Action databaseAction ) 2 { 3 try 4 { 5 databaseAction(); 6 return false; ......

Posted On Friday, July 25, 2008 4:45 PM

Generic Classes in .Net
Before I get started on Generic Classes in .Net, I'd like to give credit to CopySourceAsHtml for my new formatting of code blocks in my blog. I made some of my own enhancements, but I'd still be using the boring black on yellow formatting without CSAH. To learn how to get it to work on VS2008, go here (be sure to read the comments if you are running on XP). We've all used generic classes without thinking much about it. I use List<T> extensively (perhaps abusively). I really only discovered ......

Posted On Monday, July 21, 2008 11:07 AM

Copyright © Will Smith | Powered by: GeeksWithBlogs.net | Join free