Hi All,

i am trying to write a simple search screen, 1 text box, 1 datagrid and a search button with a datafilter.

VB Code:
  1. Dim sn As String
  2.         sn = txtSurname.Text
  3.         Dim dvCFilter As New DataView(objdsCSearch.Tables("CDetails"), _
  4.                                   "Surname = '& sn &'", _
  5.                                   "DOB", _
  6.                                   DataViewRowState.CurrentRows)
  7.             grdCDetails.DataSource = dvFilter

This works if i change ' & sn & ' to an actual surname but i need to be able to search by the name entered into the text box.

Should i be using dataview to filter?

Cheers