bookStart = "2010-07-10"; bookEnd = "2010-07-12"; SELECT * FROM booking WHERE (OrdersDate BETWEEN '" & bookStart & " 'and '"& bookEnd &"')
protected void buttonDate_Click(object sender, EventArgs e) { FilterDate(CalendarPopup1.SelectedDate,CalendarPopup2.SelectedDate); } private void FilterDate(DateTime ORDER_DATE1, DateTime ORDER_DATE2) { string connectionString = WebConfigurationManager.ConnectionStrings["NUTAILOR"].ConnectionString; SqlConnection sqlConnection = new SqlConnection(connectionString); try { sqlConnection.Open(); SqlCommand sqlCmd = new SqlCommand(); sqlCmd.Connection = sqlConnection; sqlCmd.CommandText = "select * from order where ORDER_DATE between and "; //ระหว่าง between and ใส่ค่าที่รับจาก CalendarPopup ยังไงครับ SqlDataReader sqlDr = sqlCmd.ExecuteReader(); gvProduct.DataSource = sqlDr; gvProduct.DataBind(); sqlDr.Close();
protected void buttonDate_Click(object sender, EventArgs e) { FilterDate(CalendarPopup1.SelectedDate,CalendarPopup2.SelectedDate); } private void FilterDate(DateTime ORDER_DATE1, DateTime ORDER_DATE2) { string connectionString = WebConfigurationManager.ConnectionStrings["NUTAILOR"].ConnectionString; SqlConnection sqlConnection = new SqlConnection(connectionString); try { sqlConnection.Open(); SqlCommand sqlCmd = new SqlCommand(); sqlCmd.Connection = sqlConnection; sqlCmd.CommandText = "select * from order where ORDER_DATE='2/9/2554' "; SqlDataReader sqlDr = sqlCmd.ExecuteReader(); gvProduct.DataSource = sqlDr; gvProduct.DataBind(); sqlDr.Close();
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง