Would the code below be considered "secure"?
Public Function GetManager(ByVal uname As String) As String
Dim strSelect = String.Format("SELECT UserName FROM aspnet_Users INNER JOIN Hierarchy ON UserId = LineManagerID WHERE StaffID = (SELECT UserId FROM aspnet_Users WHERE UserName = '{0}')", uname)
Dim cmdCommand = New SqlCommand(strSelect, _connection)
GetManager = cmdCommand.ExecuteScalar()
End Function
I'm looking specifically at the part..
where UserName = {'0'}, uname
Am I right in saying that the apostrophes open me up to some potential scripting attacks?
Many thanks.
DS