Click here to Skip to main content
11,632,260 members (69,876 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
i have bound agrid view as
var query3 = from p in _zentity.Tbl_Employer_History
                             join r in _zentity.Tbl_Industry
                            on p.industry_id equals r.industry_id
                             where p.member_id == memberId
                             select new { p.employer_name, p.industry_id, p.designation, p.worked_from , p.worked_to ,p.responsibilities };
                gvw.DataSource = query3;
                gvw.DataBind();
now i want only date of Work from and Work to ,not time.
what can i do
please help me soon.
Posted 20-Nov-12 0:46am
Edited 20-Nov-12 1:55am
_Amy53.1K
v2
Comments
ryanb31 at 20-Nov-12 7:51am
   
If you just want the time apply formatting to the date.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You need to apply formatting to the datetime field.
Try this:
var query3 = from p in _zentity.Tbl_Employer_History
                             join r in _zentity.Tbl_Industry
                             on p.industry_id equals r.industry_id
                             where p.member_id == memberId
                             select new
                             {
                               p.employer_name, p.industry_id, p.designation,             
                               p.worked_from.ToString("dd-MM-yyyy"), 
                               p.worked_to.ToString("dd-MM-yyyy"),p.responsibilities 
                             };
gvw.DataSource = query3;
gvw.DataBind();

--Amit
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 8,498
1 Sergey Alexandrovich Kryukov 8,149
2 Mika Wendelius 6,260
3 F-ES Sitecore 2,321
4 Suvendu Shekhar Giri 1,995


Advertise | Privacy | Mobile
Web01 | 2.8.150728.1 | Last Updated 20 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100