I have a Multiple File Uploader named "Attachments1" , and to get the cound I used "Attachments1.items.count"... then I have a Insert Into Command for SQL Server, that Inserts information into the table for every item in "Attachments1", you can see the below code...
For Each item As AttachmentItem In Attachments1.Items
Dim objConn2 As New SqlConnection("Data Source=XXX")
Dim objCmd2 As New SqlCommand("INSERT INTO clientport
(name, event, phone, email, date1, password, path, path2, filename,
number)" & "VALUES (@name, @event, @phone, @email, @date1,
@password, @path, @path2, @filename, @number)", objConn2)
for the "number" Column, I would like to insert the Count for that
file... For example if Attachments1 has 3 files it will insert into the
database the time (which works fine) the probem is the number column
doesnt make file1 for the first file, file 2 for the second file, and
file3 for the third file... Instead it puts file3 for all three rows
when it Inserts into the DB. my code is below to get the count.
Dim strcommandtext As String = ""
View Complete Post