I could use some help with the code below. I'm trying to upload multiple files into a database table. The code as it stands now only gets the first of the files I try to upload. Thanks in advance for your help.
Here's the relevant part of the code behind:
Protected Sub Upload(sender As Object, e As EventArgs)
Dim filename As String = Path.GetFileName(FileUpload1.PostedFile.FileName)
Dim contentType As String = FileUpload1.PostedFile.ContentType
If FileUpload1.HasFiles Then
For Each file In FileUpload1.PostedFiles
Using fs As Stream = FileUpload1.PostedFile.InputStream
Using br As New BinaryReader(fs)
Dim bytes As Byte() = br.ReadBytes(DirectCast(fs.Length, Long))
Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
Using con As New SqlConnection(constr)
Dim query As String = &qu ...
Go to the complete details ...