sql search

Hollowman 41 Reputation points
2021-07-26T10:36:16.277+00:00

I pulled the data using user control but I want to search within the data how can I do

  Dim myconnection As New SQLiteConnection("Data Source=" & Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\\Data" & "\data.db;Version=3")  
            myconnection.Open()  
            Dim sda As SQLiteDataAdapter  
            Dim cmd As New SQLiteCommand  
            cmd.Connection = myconnection  
            cmd.CommandText = "Select * from krp"  
            Dim rdr As SQLite.SQLiteDataReader = cmd.ExecuteReader  
            Dim dt As New DataTable  
            dt.Load(rdr)  
            rdr.Close()  
            myconnection.Close()  
  
            cmd.CommandText = <sql>SELECT * FROM krp   
                   WHERE [site] LIKE @site </sql>  
            cmd.Parameters.Add("@site", DbType.AnsiString).Value = $"%{GunaLineTextBox2.Text}%"  
            sda = New SQLiteDataAdapter(cmd)  
            sda.Fill(dt)  

117944-x.png

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,721 questions
{count} votes

Accepted answer
  1. Karen Payne MVP 35,411 Reputation points
    2021-07-27T15:37:03.817+00:00

    Make sure to consider case insensitive on the where.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.