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
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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)
Make sure to consider case insensitive on the where
.
Option Strict On
in the class or form this code resides as I noticed you don't and that can cause issues