Click here to Skip to main content
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 1:46am
Edited 20-Nov-12 2:55am
_Amy51.3K
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 Sergey Alexandrovich Kryukov 295
1 OriginalGriff 274
2 Shweta N Mishra 216
3 PIEBALDconsult 184
4 CPallini 155
0 OriginalGriff 7,630
1 Sergey Alexandrovich Kryukov 7,022
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,525


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 20 Nov 2012
Copyright © CodeProject, 1999-2014
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