vb.net - Booking Rooms (Searching between two dates) -
i'm trying search database find dates selected in datetimepickers (also inbetween dates) , remove items combobox. however, there no errors, data still in combobox once selected.
dim date1 datetime = dtpdatein.value() dim date2 datetime = dtpdateout.value() dim da oledbdataadapter = new oledbdataadapter dim bookingfound string = false myconn = new oledbconnection myconn.connectionstring = connstring myconn.open() str1 = ("select * bookinginformation [date in] >= '" & date1 & "' , [date out] <= '" & date2 & "'") dim cmd1 oledbcommand = new oledbcommand(str1, myconn) dr = cmd1.executereader while dr.read() bookingfound = true strdateout = dr("date out").tostring strdatein = dr("date in").tostring strroomnumber = dr("room number").tostring cmbrooms.items.remove(strroomnumber) end while myconn.close()
Comments
Post a Comment