I didn't use datetime as the value of my table yet I wonder why the time still showing up:
Here is my codes to get the gridview output:
private void CalendarDataGrid()
{
con.Open();
cmd = new SqlCommand(@"SELECT StocksHistory.DateTrack,Stocks.ItemID
,StocksHistory.StockIn,StocksHistory.StockOut
,StocksHistory.StockOnHand
FROM Stocks
FULL OUTER JOIN StocksHistory
ON Stocks.ItemID = StocksHistory.ItemID
WHERE DateTrack between @date1 and @date2", con);
cmd.Parameters.AddWithValue("@date1",txtDate1.Text);
cmd.Parameters.AddWithValue("@date2",txtDate2.Text);
da = new SqlDataAdapter(cmd);
dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
con.Close();
}
How can I only get the Date?