Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have bound agrid view as
C#
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
Updated 20-Nov-12 1:55am
v2
Comments
ZurdoDev 20-Nov-12 7:51am    
If you just want the time apply formatting to the date.

You need to apply formatting to the datetime field.
Try this:
C#
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
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900