Skip to content

Commit 2192844

Browse files
authored
Added security advisory
Added advice to prevent SQL Injection attacks.
1 parent bacd9f4 commit 2192844

File tree

1 file changed

+4
-0
lines changed
  • How to Issue an Insert to Put Data Into a Database

1 file changed

+4
-0
lines changed

How to Issue an Insert to Put Data Into a Database/Program.vb

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Module Program
1313
Dim connectionString As String = $"Data Source={DatabaseFileName};Version=3;"
1414

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

1822
Using conn As New SQLiteConnection(connectionString)

0 commit comments

Comments
 (0)