If you are creating the columns yourself in the DataGrid (i.e. AutoGenerateColumns=False) then you can use the DataFormatString property of the BoundColumn to specify how the data will be formatted. For example, it may have a format of:
Alternatively, you can have SQL Server return the date in the format you require by using the CONVERT method and applying the appropriate style:
VB.NET:
[COLOR=yellowgreen]-- style 3 = British/French without century. For century add 100[/COLOR]
[COLOR=#0000ff]SELECT CONVERT(VarChar, GetDate(), 3) As MyDate[/COLOR]
thk u 4 ur response
i am creating any column in datagrid
the column which in the backend(sqlserver2000),i am trying to retrieve from there
i am using format(col_name,'DD/mm/yy")
then the format is displayed in textbox or label
but i want to display in a grid according to my req. format
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.