this code works but it doesnot display multiple records.. like
if i search for Andrew, i want my code to display all names similar to
Andrew,
Alex,
Adam..etc
can anyone please help me with the code. Mu code is listed below. thanks

Private Sub Find_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim dtsr As DataTable
        Dim search As String
        search = Form1.txtsearch1.Text
        Dim da As OleDb.OleDbDataAdapter
        da = New OleDb.OleDbDataAdapter("Select * from Application Where Name LIKE'" & Trim(Form1.txtsearch1.Text) & "'", "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=J:\Alumni\Alumni\Alumni\aadb.mdb")
        dtsr = New DataTable
        da.Fill(dtsr)
        DataGridView1.DataSource = dtsr

    End Sub

huummm your code is write but there is only two three mistakes. Try this one for searching purpose.

Private Sub Find_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
''open the connection
dim str as String
dim ds as Dataset
Dim da as SqlDataAdapter
str="Select * from [Application] Where [Name] LIKE' " & Trim(Form1.txtsearch1.Text) & " ' ; "
 
        ds = New DataSet
        da = New SqlDataAdapter(str, con) '''Con is connection string pass your ''connection
        da.Fill(ds, "Application")
        DataGridView1.DataSource = ds
        DataGridView1.DataMember = "Application"

end sub

Andrew,
Alex,
Adam..etc

How is Alex similar to Andrew?
starts with A?
please explain what you mean by similar

huummm your code is write but there is only two three mistakes. Try this one for searching purpose.

Private Sub Find_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
''open the connection
dim str as String
dim ds as Dataset
Dim da as SqlDataAdapter
str="Select * from [Application] Where [Name] LIKE' " & Trim(Form1.txtsearch1.Text) & " ' ; "
 
        ds = New DataSet
        da = New SqlDataAdapter(str, con) '''Con is connection string pass your ''connection
        da.Fill(ds, "Application")
        DataGridView1.DataSource = ds
        DataGridView1.DataMember = "Application"

end sub

ooh, m sorry. Yes, i want all similar datas to be displayed as in starting with Letter....A. or if m looking for name tat starts with C all similar names starting with C....thanks for the reply

da = New OleDb.OleDbDataAdapter("Select * from Application Where Name LIKE'" & Trim(Form1.txtsearch1.Text).Substring(0,1) & "%'", "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=J:\Alumni\Alumni\Alumni\aadb.mdb")

try and replace this The code is
for A is

"Select * from Application Where Name LIKE'A%'"

For C is

"Select * from Application Where Name LIKE'C%'"
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.