btntxtbox.Enabled = False txtquick.Visible = False
txtquick.Visible = True btnquick.Enabled = False btntxtbox.Enabled = True txttitle.Enabled = False txtauthor.Enabled = False txtdewey.Enabled = False txtsubj.Enabled = False txttitle.BackColor = Color.Aqua txtauthor.BackColor = Color.Aqua txtdewey.BackColor = Color.Aqua txtsubj.BackColor = Color.Aqua
txtquick.Visible = False btnquick.Enabled = True btntxtbox.Enabled = False txttitle.Enabled = True txtauthor.Enabled = True txtdewey.Enabled = True txtsubj.Enabled = True txttitle.BackColor = Color.Lime txtauthor.BackColor = Color.Lime txtdewey.BackColor = Color.Lime txtsubj.BackColor = Color.Lime
Private Sub txtquick_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtquick.TextChanged 'we set her our SQL statements sql = "Select * from book_profile where title like '%" & txtquick.Text & "%' or author LIKE '%" & txtquick.Text & "%'" dt = New DataTable Try 'open the connection con.Open() 'bind the SQL and the connection through OleDBDataAdaoter and stored to da da = New OleDb.OleDbDataAdapter(sql, con) 'and whatever the value of da will be fill into dt our imaginary data table da.Fill(dt) 'get the datasource of datagridview from our data table dtgresult.DataSource = dt Catch ex As Exception 'will throw an error if something went wrong. End Try 'close connection End Sub