我使用ASP.NET从数据库加载数据以显示购买的物品的日期,但它也在其旁边显示12:00:00 AM的时间戳。投射字符串日期作为日期
如何打印该值才能显示日期?
private void UpdateInventory(int index)
{
DataView inventoryTable = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
DataRowView row = (DataRowView)inventoryTable[index];
currentInventory.fac_ID = row["fac_ID"].ToString();
currentInventory.inv_Quantity = row["inv_Quantity"].ToString();
currentInventory.inv_Purchase_Date = row["inv_Purchase_Date"].ToString();
lblFacilityID.Text = currentInventory.fac_ID;
lblQuantity.Text = currentInventory.inv_Quantity;
lblPurchaseDate.Text = currentInventory.inv_Purchase_Date;
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
UpdateInventory(DropDownList1.SelectedIndex);
}
public string fac_ID { get; set; }
public string inv_Quantity { get; set; }
public string inv_Purchase_Date { get; set; }