in CustomersBusinessObject i have like this.
interface CustomersInterface
{
DateTime joiningdate
{
get;
set;
}
}
public class Customers : ICustomersInterface
{
public DateTime joiningdate
{
get
{
return _date;
}
set
{
_date = value;
}
}
}
in DAL
public List<customers> getcustomers()
{
try
{
List<customers> lstcustomers = new List<customers>();
SqlConnection con = new SqlConnection(constring);
cmd = new SqlCommand("SELECT empid, empname,departmentid, joiningdate, locationid, salary, jobid, Isworking from employee", con);
con.Open();
dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
Customers cst = new Customers();
cst.employeeid = (int)dr[0];
cst.empname = (string)dr[1];
cst.departmentid = (int)dr[2];
cst.joiningdate = (DateTime)dr[3];
cst.locationid = (int)dr[4];
cst.salary = (int)dr[5];
cst.jobid = (int)dr[6];
cst.isworking = (bool)dr[7];
lstcustomers.Add(cst);
}
}
return lstcustomers;
}
catch (Exception ex)
{
throw;
}
here i want to display only date but it is coming datetime
where i should modify please help me
thank you.