G
Guest
I have a select statement that isn’t functioning properly:
private void Page_Load(object sender, System.EventArgs e)
{
myClubNow1=new
DateTime(DateTime.Now.Year,DateTime.Now.Month,DateTime.Now.Day);
dsClub=new DataSet();
string
strClubconn=ConfigurationSettings.AppSettings["ConnectionString"];
ClubConn=new SqlConnection(strClubconn);
ClubConn.Open();
string strClubcmdRead="SELECT EVNR_tbl.* FROM EVNR_tbl
WHERE EVNR_tbl._Date BETWEEN '" + myClubNow1.Date.ToString("dd/MM/yyyy") + "'
AND '" + myClubNow1.Date.AddDays(3).ToString("dd/MM/yyyy") + "'";
clubAdapt=new SqlDataAdapter(strClubcmdRead, ClubConn);
clubAdapt.Fill(dsClub,"EVNR_tbl");
Repeater1.DataSource=dsClub;
Repeater1.DataBind();
ClubConn.Close();
}
When I debug it shows the proper dates but at run-time when the site comes
up it doesn’t return any event information even though I know the table
EVNR_tbl has information. The Structure of the data table is as follows:
Column Name datatype example
EVNRID int 1
_Date DateTime 04/03/2005
Duration int 1
Broadcast bit 0
EventTitle char(255) Vivid's last night
Description Text Last night etc etc
Details Text Etc etc etc
I don’t know why it is not returning any data on the web site when I know
there are records. It was working yesterday. Please help.
private void Page_Load(object sender, System.EventArgs e)
{
myClubNow1=new
DateTime(DateTime.Now.Year,DateTime.Now.Month,DateTime.Now.Day);
dsClub=new DataSet();
string
strClubconn=ConfigurationSettings.AppSettings["ConnectionString"];
ClubConn=new SqlConnection(strClubconn);
ClubConn.Open();
string strClubcmdRead="SELECT EVNR_tbl.* FROM EVNR_tbl
WHERE EVNR_tbl._Date BETWEEN '" + myClubNow1.Date.ToString("dd/MM/yyyy") + "'
AND '" + myClubNow1.Date.AddDays(3).ToString("dd/MM/yyyy") + "'";
clubAdapt=new SqlDataAdapter(strClubcmdRead, ClubConn);
clubAdapt.Fill(dsClub,"EVNR_tbl");
Repeater1.DataSource=dsClub;
Repeater1.DataBind();
ClubConn.Close();
}
When I debug it shows the proper dates but at run-time when the site comes
up it doesn’t return any event information even though I know the table
EVNR_tbl has information. The Structure of the data table is as follows:
Column Name datatype example
EVNRID int 1
_Date DateTime 04/03/2005
Duration int 1
Broadcast bit 0
EventTitle char(255) Vivid's last night
Description Text Last night etc etc
Details Text Etc etc etc
I don’t know why it is not returning any data on the web site when I know
there are records. It was working yesterday. Please help.