I am trying to take my typed in text from a textbox in my aspx page and pass it to my database for a query, but I dont have any errors. And when I put a break point my ElseIf sections dont evaluate. Where did I go wrong?
Protected Sub SearchButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles SearchButton.Click
Dim DS As New DataSet
If SearchTextBox.Text = "" Or NameSearchTextBox.Text = "" Then
DS = RunQuery("SELECT * FROM tblFiles WHERE Status = '" & radiolist1.SelectedValue & "'")
GridView1.DataSource = DS
GridView1.DataBind()
If radiolist1.SelectedValue = "*" Then
BindGrid()
End If
ElseIf SearchTextBox.Text.Length >= 1 Then
DS = RunQuery("SELECT * FROM tblFiles WHERE Number like '%" & SearchTextBox.Text & "%'")
GridView1.DataSource = DS
GridView1.DataBind()
ElseIf NameSearchTextBox.Text.Length >= 1 Then
DS = RunQuery("SELECT * FROM tblFiles WHERE Member like '%" & NameSearchTextBox.Text & "%'")
GridView1.DataSource = DS
GridView1.DataBind()
End If
End Sub
Thanks!