Monday, October 15, 2012

Operand type clash: int is incompatible with uniqueidentifier



When you get above error please double check following

- you are inserting into table from view
- table has column with data type - uniqueidentifier  with allow null
- view is returning null for uniqueidentifier field
- you have to convert null to uniqueidentifier field in view 

for example ,convert(uniqueidentifier,null) as MyUniqueIdentifierField  

Tuesday, October 2, 2012

Autogenerate get and set class properties



1) use  notepad ++ to generate class private properties
2)
You can right-click on the field and go to Refactor > Encapsulate Field. That will generate a public Property. You still have to do each one at a time but it's a lot faster than the typing!