frankyb 0 Newbie Poster

Hi i am trying to search in a database and can do it with the code attached, but how can i instead of putting "date > '1/1/00'", use what a user inputs in a textbox. I have tried "date > 'textbox1.text'" but this doesnt work, any help is much appreciated.

Private Sub GetRowsByFilter()
   Dim t As DataTable
   t = DataSet1.Tables("Orders")
   ' Presuming the DataTable has a column named Date.
   Dim strExpr As String
   strExpr = "Date > '1/1/00'"
   Dim foundRows() As DataRow
   ' Use the Select method to find all rows matching the filter.
   foundRows = t.Select(strExpr)
   Dim i As Integer
   ' Print column 0 of each returned row.
   For i = 0 to foundRows.GetUpperBound(0)
      Console.WriteLine(foundRows(i)(0))
   Next i
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.