Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added security advisory
Added advice to prevent SQL Injection attacks.
  • Loading branch information
InteXX authored Apr 24, 2024
commit 21928443fa11918033c19445e97ee73a68c054d4
4 changes: 4 additions & 0 deletions How to Issue an Insert to Put Data Into a Database/Program.vb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Module Program
Dim connectionString As String = $"Data Source={DatabaseFileName};Version=3;"

' Set up parameterized SQL query
' -----------------------------------------------------------------------------
' Security Note: Never concatenate (or join) a string into a SQL statement.
' Always use parameterized queries to prevent SQL Injection attacks.
' -----------------------------------------------------------------------------
Dim query As String = "INSERT INTO Users (Name, Country) VALUES (@Name, @Country)"

Using conn As New SQLiteConnection(connectionString)
Expand Down