By default when a page is posted back in MVC3 it retains the form values. so on redisplay of the same page, we find the values are retained. In case this need to be disallowed the following can be used so the model does not retain its state. ModelState.Clear(); It can also be used […]
I just had a need to loop through all the properties of an object and copy the values of the properties to another object of the same type. I just discovered that we can use System.Relection to get this done. For example two objects sourceObject and destinationObject are objects of class Person. using System.Reflection; namespace […]
While filling a .Net DataSet with data from MySql, date fields can cause the error Unable to convert MySQL date/time value to System.DateTime After some research, I found a solution to this issue is to use DATE_FORMAT in the select statement like below SELECT FirstName, LastName, DATE_FORMAT(RegistrationDate, ‘%d/%m/%Y’) AS DateOfRegistration, […]
I have been facing a problem with Visual studio 2010’s intellisense. Firstly it didn’t show any intellisense options until I hit a Cntl+space and when I fixed that the auto fill would not complete until you manually select the required option from the intellisense list.
Performace optimized code for accessing values from resource file and config files.