The first part of this work is done correctly, when the text box value is empty. Although it throws an exception, when I try to filter the search using the second part of the if statement.
The table var is set in that way, because the user has the option of loading separate tables.
The text box is the string search parameter
the public class form1 slow thief OleDbConnection = new OleDbConnection ("provider = Microsoft.ACE.OLEDB.12.0 ;. =. \ Service.accdb; ") Dim Da New OleDbDataAdapter Private Sub GetData (as) Me.Refresh () DT Dim New DataTable Dim cmd New OleDbCommand Dim table txt string = TextBox1.Text as string = ComboBox1.Text .ToString is as dim as as .toString then TextBox1.Text = is nothing but then con.Open () da.SelectCommand = New OleDbCommand ("Select from * [" & amp; In the table & amp; "],", thief con.Close () or else con.Open () Da.SelectCommand = New OleDbCommand ("[& quot; Select & quot; Select & amp; Such as '%' & amp; Txt & amp; amp;; '%' or '%' such as & amp; amp;; & # 39; Txt & amp;; '%' or '%' & quot; Txt & amp; Thief) con.Close () end then try da.Fill (DT) capture exception as MsgBox (ex.ToString) expires DataGridView1.DataSource = DT End Sub Ending Class
< P> Any help would be appreciated. Edit
It seems that this bit of code is preventing it from searching correctly, but without it I can not save DB. . OleDbCommandBuilder = Dynamic Builder. QuotePrefix = Think I'm missing the parameter from this section?
Comments
Post a Comment