Dim myMatches As MatchCollection Dim myRegex As New Regex("\w+") Dim t As String t = TextBox5.Text myMatches = myRegex.Matches(t) ' Search for all the words in a string Dim successfulMatch As Match For Each successfulMatch In myMatches ListBox1.Items.Add(successfulMatch.Value) Dim sql As String = " Select * from Courses_Tbl where Crs_Desc Like ''"& t &"'%' or Crs_Desc Like '%'"& t &"''" Dim adp As New SqlDataAdapter(sql, con) Dim com As New SqlCommand(sql, con) Dim adp As New SqlDataAdapter(sql, con) Dim ds As New DataTable adp.Fill(ds) Next GridView2.DataSource = ds GridView2.DataBind() Next GridView2.DataSource = ds GridView2.DataBind()
select *
where
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)