Can any guy tell me what is the differnce between a datareader and a dataadapter? Also what are the other method to search data through SQL queries??

Datareader needs an opened database connection.
Its an Connected Oriented Architecture

Private Sub loop_QTY()
        Dim sql As String = "SELECT Item_Qty from tbl_Products WHERE Item_Name = '" & cbo_Items.Text & "' "

        Dim cmd As New OleDbCommand(sql, con)
        Dim dr As OleDbDataReader

        dr = cmd.ExecuteReader()
        While dr.Read()
        End While
    End Sub

Dataadapter does not need an Open Database connection
Its an Disconnected Access

 Dim dt As New DataTable
Dim da As New SqlDataAdapter("select * from data", cn)
For Each row As DataTable In ds.Tables("data").Rows
If row(0).ToString = ComboBox1.Text Then
TextBox3.Text = dt.Rows(0)("type").ToString()
TextBox4.Text = dt.Rows(1)("shape").ToString()
TextBox5.Text = dt.Rows(2)("size").ToString()
TextBox6.Text = dt.Rows(3)("place").ToString()
TextBox7.Text = dt.Rows(1)("weight").ToString()
TextBox3.ReadOnly = True
TextBox4.ReadOnly = True
TextBox5.ReadOnly = True
TextBox6.ReadOnly = True
TextBox7.ReadOnly = True
Exit For
End If
Be a part of the DaniWeb community

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