473,320 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

asp.net - datagrid and date?

Hi.

I have a problem getting date coorect in my datagrid.
Date in the database is integer like this 20010614
I create a View and I have tried cast but I can not get passed dd.mm.yyyy
hh:mm:ss
I want the date in the grid to come out as dd.mm.yyyy

Any ideas?

Thanks

Morten
Jul 21 '05 #1
2 1545
Hi,
I would prefer to do the conversion in the backend
Something like this
declare @m int
set @m = 20010605

select cast(substring(cast(@m as varchar(10)),1,4) + '.' +
substring(cast(@m as varchar(10)),4,2)
+ '.' + substring(cast(@m as varchar(10)),8,2) as datetime)

Thanx
Deep
-----Original Message-----
Hi.

I have a problem getting date coorect in my datagrid.
Date in the database is integer like this 20010614
I create a View and I have tried cast but I can not get passed dd.mm.yyyyhh:mm:ss
I want the date in the grid to come out as dd.mm.yyyy

Any ideas?

Thanks

Morten
.

Jul 21 '05 #2
Thanks Deepankar
"Deepankar" <de*****@hotmail.com> skrev i melding
news:06****************************@phx.gbl...
Hi,
I would prefer to do the conversion in the backend
Something like this
declare @m int
set @m = 20010605

select cast(substring(cast(@m as varchar(10)),1,4) + '.' +
substring(cast(@m as varchar(10)),4,2)
+ '.' + substring(cast(@m as varchar(10)),8,2) as datetime)

Thanx
Deep
-----Original Message-----
Hi.

I have a problem getting date coorect in my datagrid.
Date in the database is integer like this 20010614
I create a View and I have tried cast but I can not get

passed dd.mm.yyyy
hh:mm:ss
I want the date in the grid to come out as dd.mm.yyyy

Any ideas?

Thanks

Morten
.

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Soul | last post by:
*** I am not sure this question belong to *.languages.csharp or *.framework.windowsdorms.databinding, so I post to both *** Hi, Currently I have a DataGrid which bind to a DataSet. One of...
3
by: Andrew S. Giles | last post by:
Hello, I am importing a flat text file, and putting it into a datagrid for display on a form. Currently the users have their dates and times seperated. I have two fields, therefore in the...
2
by: brian richards | last post by:
The datagrid in my page always looks greyed out. But DataGrid.Enabled is set to true. It's never set to false. Is there any other way enabled may be set to false? Or maybe another reason other than...
1
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
5
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
4
by: yer darn tootin | last post by:
Does anyone know the sort expression for a column that's data has been returned in the format, eg '07 Jul 05'?? The sort expression {..:"dd mmm yy"} doesn't work ( if the column was returned as...
14
by: Brett Sinclair | last post by:
Hello everybody I'm still on the learning curve here...and from what I read, I created inherited datagrid class so I could have icons, combobox...etc in the columns of my datagrid. The grid...
2
by: Mike Baugh | last post by:
I am using visual studio 2005 to develop a form using c# I have 3 datagrids on one form. I can set the row color based on a certain value in a column. However this color applies to all 3...
1
by: Brock | last post by:
First note that I am using Framework 1.1. I have an .aspx page that is displaying a list of employees, but only the Employee Number, First Name, Last Name, and Title. It is working great. I...
1
by: Brock | last post by:
Thanks in advance... (you can see a screenshot of what my form looks like currently at http://www.juggernautical.com/DataGrid.jpg - the Datalist is super-imposed in 'design view' but the DataGrid...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.