0
Talk good morning guys!
I’m having a little difficulty regarding use of Monthecalendar...
I have a scheduling system by DATA, which after registering the given event, it is presented in DATAGRIDVIEW,with the following code
`public void GetData()
{
try
{
cg.con = new SqlConnection(cn.DBconn);
cg.con.Open();
cg.cmd = new SqlCommand("SELECT RTRIM(Id),RTRIM(Nome) ,RTRIM(Endereco), RTRIM(Quadra), RTRIM(Lote), RTRIM(Telefone), RTRIM(Celular),(Data), RTRIM(Hora), RTRIM(Email), RTRIM(Observacao), RTRIM(Locacao), RTRIM(Evento), RTRIM(Estado) from Eventos order by Data", cg.con);
cg.rdr = cg.cmd.ExecuteReader(CommandBehavior.CloseConnection);
DGW_Agenda.Rows.Clear();
while (cg.rdr.Read() == true)
{
DGW_Agenda.Rows.Add(cg.rdr[0], cg.rdr[1], cg.rdr[2], cg.rdr[3], cg.rdr[4], cg.rdr[5], cg.rdr[6], cg.rdr[7], cg.rdr[8], cg.rdr[9], cg.rdr[10], cg.rdr[11], cg.rdr[12], cg.rdr[13]);
}
cg.con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}`
What I would like is that when I clicked on some date in the monthercalendar it checked my datagridview in the column 'SCHEDULING DATE' if the date is scheduled, or available date for registration.
And the code where it is? You can’t check on
DataSource
, Do you want when selecting a date it tells you it is not available or disable the unavailable dates in the selection? Will the system be used by multiple users? Are you doing some consistency control? Elaborate further your question by presenting a [MCVE]– Leandro Angelo
Hello @Leandroangelo I can not check it in my datasource, I researched some foruns how to do this check, but I’m a little lost. The idea is only to check if the date is registered according to the registered event! doing the check in the datasource column.
– Lucas_Silva
I don’t understand why you can’t consult the datasource... but anyway if you present the code, there’s no way to help
– Leandro Angelo