3
Reply

ListView Coding

Ask a question
Anil Raina

Anil Raina

9y
320
1
I want to insert only date in my listview as I am Printing the listView it shows date and time also but I want only date to print.The part of my program code is shown below
 
OleDbCommand cmd = new OleDbCommand("select * from view_attemp where emp_id='" + (this.lstv_AttEmp.Items[lstv_AttEmp.FocusedItem.Index].SubItems[0].Text.Trim()) + "' and att_date=#" + date.Value.Date + "#", clsCon.cn);
OleDbDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
strEditID = dr["emp_id"].ToString();
// strEditDate = Convert.ToDateTime(dr["att_date"]);
this.comEname .SelectedText = dr["emp_name"].ToString();

this.date .Value = Convert.ToDateTime(dr["att_date"]);
this.comStatus .SelectedText = dr["att_status"].ToString();
this.txtTime .Text = dr["att_time"].ToString();
this.txtRemarks.Text = dr["remarks"].ToString();


}
Kindly Help to get Out of It as soon as possible

Answers (3)