Copy a generic list, List<>, by ref, by value wierdness

Here is my latest weird problem. I had a generic list, I wanted to  make a copy of it. So the aproach I used was to make the new list = the first one. Enter the wierdness; any mods to the second list showed up in the first one. So I guess it used a pointer or passed it by reference instead of  making a copy like I expected. Live and learn I guess. The work around was to initialize it blank and call...

October 19th, 2009 by B.Harding 
Comments Off on Copy a generic list, List<>, by ref, by value wierdness

Insert with FormView using Linq

I had a wierd error trying to insert data using a formview today. The jist is this: the formview was trying to use an empty string for an int field instead of Nothing. Here is the error I saw, helpful huh? Failed to set one or more properties on type xxxxxxx  Ensure that the input values are valid and can be converted to the corresponding property types. The fields are allowed to be null but...

February 5th, 2009 by B.Harding 

Operator ‘==’ incompatible with operand types ‘Int32’ and ‘Object’

I had this error pop up on me recently. Operator ‘==’ incompatible with operand types ‘Int32’ and ‘Object’ I had an good grasp on why but the stack track would not tell me where! The issue is that a null object was being used in a where clause somewhere. Linq translated the null as “” and could not be compared the the ID field which is an int. My solution...

February 5th, 2009 by B.Harding