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 0:46am
Edited 20-Nov-12 1:55am
_Amy51K
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)



Advertise | Privacy | Mobile
Web04 | 2.8.141022.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