gridview giving error

Posted by Sreekanthv5 under ASP.NET on 9/6/2011 | Points: 10 | Views : 818 | Status : [Member] | Replies : 1
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>




Responses

Posted by: Rickeybglr on: 9/6/2011 [Member] Starter | Points: 25

Up
0
Down
can u plz specify wat is the error??? and at wat line.

Sreekanthv5, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response