S srivalli Well-known member Joined May 4, 2005 Messages 189 Programming Experience Beginner Jun 11, 2005 #1 i enter some data in access using front end. what do i do for searching a word or a phrase in access using vb.net or asp.net . better if quick response is given. thank u
i enter some data in access using front end. what do i do for searching a word or a phrase in access using vb.net or asp.net . better if quick response is given. thank u
B bfsog Well-known member Joined Apr 21, 2005 Messages 50 Location UK Programming Experience 5-10 Jun 11, 2005 #2 Use the SQL command LIKE in a WHERE clause. This code will search a column called product_desc for any values that contain the word "electronic" VB.NET: Me.OleDbSelectCommand.CommandText = "SELECT * FROM table_name WHERE firstname LIKE '%electronic%'" However, lets say you wanted to return words that started with a certain letter(s), your query would be VB.NET: SELECT * FROM table_name WHERE column_name LIKE 'b%' Any word in column_name that began with a b would be extracted. On the other hand, if you wanted to return words that ended with a certain letter your query would be VB.NET: SELECT * FROM table_name WHERE column_name LIKE '%t' For example that query would return words like: cat, hat and flat Hope This Helps Upvote 0 Downvote
Use the SQL command LIKE in a WHERE clause. This code will search a column called product_desc for any values that contain the word "electronic" VB.NET: Me.OleDbSelectCommand.CommandText = "SELECT * FROM table_name WHERE firstname LIKE '%electronic%'" However, lets say you wanted to return words that started with a certain letter(s), your query would be VB.NET: SELECT * FROM table_name WHERE column_name LIKE 'b%' Any word in column_name that began with a b would be extracted. On the other hand, if you wanted to return words that ended with a certain letter your query would be VB.NET: SELECT * FROM table_name WHERE column_name LIKE '%t' For example that query would return words like: cat, hat and flat Hope This Helps