hi frnds , i have a one column in database like validity (datetime datatype)
SqlCommand cmd = new SqlCommand("select date from salesdetails ", con); SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { txtvalidity.Text = dr[0].ToString(); } }
SqlCommand cmd = new SqlCommand("select select convert(varchar,date,103) as date from salesdetails ", con); SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { txtvalidity.Text = dr[0].ToString(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)