@DATE date = (CONVERT(varchar,dateadd(d,-(day(getdate())),getdate()),106))
protected void Page_Load(object sender, EventArgs e) { using (SqlConnection conn = new SqlConnection(dbConn)) { try //Call stored procedure { SqlCommand cmd = new SqlCommand(spddl, conn); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); if (!IsPostBack) { DATE_DOWN_LIST.DataSource = ds.Tables[0]; DATE_DROP_DOWN_LIST.DataTextField = ds.Tables[0].Columns["DATA_DATE"].ToString(); DATE_DROP_DOWN_LIST.DataBind(); } } catch (Exception i) { bool exception = true; if (exception == true) { //txtMessage.Text += e.Message; } } } }
DataTextFormatString = "{0:dd/MM/yyyy}";
ds.Tables[0].Columns["DATA_DATE"].ToString("dd/MM/yyyy")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)