vb.NET inserting a file to a Binary field in the Database

In order to store Binary data in a table, all that is needed is to upload the bytes from the file, one way to do this is to use File.ReadAllBytes

Dim fileName As String = "C:\testfile.txt"
 
dbCommand = New SqlCommand("UPDATE FileTable SET BinaryFile=@BinaryFile WHERE FileId = @FileId", dbConnection)
dbCommand.Parameters.AddWithValue("@BinaryFile", File.ReadAllBytes(Filnamn))
dbCommand.Parameters.AddWithValue("@FileId", FileId)
 
dbCommand.ExecuteNonQuery()