public void datasNegrito() { //criar um adaptador SqlConnection conexao = new SqlConnection("Data Source = DESKTOP-L0FTKI7; Initial Catalog = ALTERNATIVA; Integrated Security=SSPI"); conexao.Open(); string query = "SELECT Datae FROM Agenda"; SqlCommand cm = new SqlCommand(query, conexao); SqlDataReader reader = cm.ExecuteReader(); string date; while (reader.Read()) { date = Convert.ToString(reader["Datae"]); int dia = Convert.ToInt32(date.Substring(0, 2)); int mes = Convert.ToInt32(date.Substring(3, 2)); int ano = Convert.ToInt32(date.Substring(6, 4)); string dataRecebe = Convert.ToString(ano) + "," + Convert.ToString(mes) + "," + Convert.ToString(dia); MCalendario.AddBoldedDate(Convert.ToDateTime(dataRecebe)); } }
private void MCalendario_DateSelected(object sender, DateRangeEventArgs e) { MCalendario.Refresh(); Calendario(); }