I'm developing an application in C # in Visual Studio. In this application there is a screen that tells you how many events the user has today, tomorrow and the day after tomorrow (green header).
Follow the screen:
Ineedacodethatcomparesthecurrentdatewiththedateenteredintheeventdatabaseandsendsthenumberofeventsrecordedforfuturedays.
Eg:On05/08/2016auserregisteredaneventfortoday(08/08/2016)andthiseventwasanalyzedbythecodeandthesumoftoday'sevents(08/08/2016)wassentforlabel.Text
andsoon.
Inshort,thecodeshouldanalyzetheeventsforthreedaysandsendthesumofeventstothreelabel.Text
,currentday,dayafterdayanddayafterday.
ThecodeinwhichIquerythebank:
publicDataTableLoad(stringsql){DALTextoobjSqlCeServerDAL=DALTexto.GetInstance(connString);objSqlCeServerDAL.Open();SqlCeDataAdapterdAd=newSqlCeDataAdapter(sql,objSqlCeConnection);dAd.SelectCommand.CommandType=CommandType.Text;DataSetdSet=newDataSet();try{dAd.Fill(dSet,"textos");
return dSet.Tables["textos"];
}
catch
{
throw;
}
finally
{
dSet.Dispose();
dAd.Dispose();
objSqlCeServerDAL.Dispose();
}
}