i have been having trouble trying to find out what is wrong with my sql select query... i wanted to select a sessionID by comparing the tourID and dates. the dates datatype at the database is datetime and the value of itemSessionDate is in string. i tried to convert itemSessionDate to date and dateAndTime but it gave me mm/dd/yyyy while the date in my database is dd/mm/yyyy hh:mm:ss. so i thought i can try using the itemSessionDate string as it has the same value as the one return from the database. but it keeps on goin to the if not reader.hasRows and quit the statement
could somebody teach me how to solve this problem....
below are my code
Private Function getItemSessionID(ByVal tourID As String, ByVal itemSessionDate As String)
Dim sessionID As String = ""
Dim strConn As String = ConfigurationManager.ConnectionStrings("ProrsumDBConnectionString").ConnectionString
'create sql connection
Dim myConn As New SqlConnection(strConn)
'Open connection; Note: You need to open a connection to database
Dim cmd As String = "SELECT sessionID " & _
" FROM TourSession " & _
" WHERE tourID=" & Integer.Pars
View Complete Post