Friday, 22 August 2014

How to add default constraint to table column in sql table or Set default value to a column in sql table using sql Query.


Add default constraint to table column or Set default value to a column in sql table using sql Query.



ALTER TABLE [TableName] ADD  CONSTRAINT [ConstraintName]  DEFAULT (getdate()) FOR [ColumnName]



In Above Query adding getdate() default value to Column.
 

Friday, 8 August 2014

Display enum value in string format, in WEB API Response page.





Add below configuration in WebApiConfig Class, in Register Method.

json.SerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());