Re: date only to be selected
I'd suggest trying something similar to the following:
Code:
DateTime dtFromSQL;
sqlCommand = new SqlCommand("SELECT date FROM Transactions", sqlConnection);
sqlDataReader = sqlCommand.ExecuteReader();
while (sqlDataReader.Read())
{
dtFromSQL = DateTime.Parse(sqlDataReader["date"].ToString());
comboBoxResult.Items.Add(dtFromSQL.ToShortDateString());
}
Depending on how you want to display your date, once you have it in the DateTime variable, you can format it however you want, short date being the "mm/dd/yyyy" if using the Engish (US) culture.
If this resolves your question, please mark as resolved and rate up. Thanks!
-Quinn
Re: date only to be selected
Wouldn't you need to use "SELECT [date] FROM Transactions" since date is a reserved word?