i have made a seach for my homepage so the users can seach for people they want to chat with but ive been sitting with this problem for a while now, when im using normal text boxes its easy enough and im not really having any problems but then i go over to saying it have to count in the drop down list so people can click if they want to seach for all the female members or male members i have done this so far:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ddlGender.Items.Add(New ListItem("--All--", 0))
ddlGender.Items.Add(New ListItem("Female", 1))
ddlGender.Items.Add(New ListItem("Male", 2))
End Sub
and ive made a class as well:
Public Function AdvancedSearch(ByVal pro As SearchPro) As DataTable
Dim objData As New DataAccess
Dim strSQL As String = "select fldID,fldusername,fldage,fldname,fldgender,fldlastname from tbllogin where (fldGender like ?GenderSearch) and (fldusername like ?keyword and fldname like ?keyword) and (fldage>=?minAge and fldage<=?maxAge)"
Dim objCMD As MySqlCommand = New MySqlCommand(strSQL)
objCMD.Parameters.Add("?keyword", MySqlDbType.VarChar).Value = "%" & pro.Keyword & "%"
objCMD.Parameters.Add("?minAge", MySqlDbType.Int32).Value = pro.minAge
objCMD.Parameters.Add("?maxAge", MySqlDbType.Int32).Value = pro.maxAge
objCMD.Parameters.Add("?GenderSearch", MySqlDbType.Int32).Value = pro.GenderSearch
Return objData.GetData(objCMD, _con