heeey guys
I have a question, I have here a data time field that is saved in the db as date time and it need to be a date time , and I want to load this Field in a drop down but not the hole value just the year
thanks for help and fast answer !
I have a question, I have here a data time field that is saved in the db as date time and it need to be a date time , and I want to load this Field in a drop down but not the hole value just the year
}
protected
void
LoadYear()
{
SqlConnection connection =
new
SqlConnection(ConfigurationManager.ConnectionStrings[
"HolidayTrackerConnectionString"
].ConnectionString);
SqlDataAdapter adapter =
new
SqlDataAdapter(
"SELECT * FROM HtVacationDay"
, connection);
DataTable dt =
new
DataTable();
adapter.Fill(dt);
rcbYear.DataTextField =
"FromDate"
;
rcbYear.DataValueField =
"VacationDayId"
;
rcbYear.DataSource = dt;
rcbYear.DataBind();
rcbYear.Items.Insert(0,
new
RadComboBoxItem(
"-Select a Year-"
));
}