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());

Friday, 18 July 2014

WPF WrapPanel Layout Control



Wrap Panel
WrapPanel positions child elements in sequential position from left to right or top to bottom. Default positioning is left to right.

<WrapPanel>
        <Button Margin="4" Width="100">First</Button>
        <Button Margin="4" Width="100">Second</Button>
        <Button Margin="4" Width="100">Third</Button>
        <Button Margin="4" Width="100">Fourth</Button>
        <Button Margin="4" Width="160">Fifth</Button>
        <Button Margin="4" Width="160">Sixth</Button>
        <Button Margin="4" Width="200">Seventh</Button>
</WrapPanel>
If you want to position child controls to top to bottom, set WarpPanel Property  Orientation="Vertical"