vb.net - SQL for oledbDataAdapter search function -


I am currently trying to create a search function on a page in VB.NET, which would allow me to search for a database Will allow customerID from a text box called txt search and then it is presented in the datagrid.

So far, I can display customerID by using customers using

  manually where 'A%' like a customer ''   

but do not know how to replace A with data that will be inserted in the text box.

You can use this to pass in the query using syntax:

  select from customers where customer ID @ search search + '%'   

in VB.NET

  dim struct "Select" in the form of a string * Ask customers, such as customer ID @ search param + '%' "SqlCommand = new SQL Commands (Structured, Connection) CMD as the CMD CommandsType = Commandat Wipe Text DMRM SQLPRMRAR = new escappamator ("@SearchParam", SKLDB Type VC, 50) PreMDER Ection = ParameterDirection.Input prm.Value = txtUser.Text cmd.Parameters.Add (prm)    

Comments