TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sreekanth v
NA
51
0
Gridveiw error
Sep 6 2011 12:00 AM
It is displaying empty in datetime column in gridview.
plz help
BO.cs
public class cmp:Icmp
{
DateTime? _datetime;
public int Employeeid
{
get;
set;
}
public string EmpName
{
get;
set;
}
public int jobid
{
get;
set;
}
public int managerid
{
get;
set;
}
public DateTime? hiredate
{
get { return _datetime; }
set { value = _datetime; }
}
in DAL.cs
public List<cmp> GetEmployees()
{
List<cmp> listemmployees = new List<cmp>();
CompanyDataContext db = new CompanyDataContext();
listemmployees = db.Employees.Select(p => new cmp { Employeeid = p.empid, EmpName = p.empname, hiredate=p.hiredate }).ToList();
return listemmployees;
}
in Default.aspx
<asp:GridView ID="gv1" runat="server" DataSourceID="osd"
AutoGenerateColumns="False" AutoGenerateEditButton="True" DataKeyNames="Employeeid"
AutoGenerateDeleteButton="True" AllowPaging="True" PageSize="3" AutoGenerateSelectButton="true" EnablePersistedSelection="true" >
<Columns>
<asp:BoundField DataField="Employeeid" HeaderText="Employeeid"
SortExpression="Employeeid" />
<asp:BoundField DataField="EmpName" HeaderText="EmpName"
SortExpression="EmpName" />
<asp:BoundField DataField="jobid" HeaderText="jobid" SortExpression="jobid" />
<asp:BoundField DataField="managerid" HeaderText="managerid"
SortExpression="managerid" />
<asp:BoundField DataField="hiredate" HeaderText="hiredate"
SortExpression="hiredate" />
<asp:BoundField DataField="salary" HeaderText="salary"
SortExpression="salary" />
</Columns>
</asp:GridView>
Reply
Answers (
1
)
Replace Empty value in XSLT file
Identity