I am trying to use the radupload device twice on the same page.
I have two seperate database fields for holding the names of a standard and technical graphic.
The graphics have two different folder areas on the server.
Is it possible to load the radupload twice on the page with the select ability limited to 1 file per control and succesfully insert the field infornation using a stored procedure?.
I have supplied my standard code for 1 radupload in the hope that you can see my potential issue pulling from two seperate radupload controls.
Code -----------------
If RadUpload1.UploadedFiles.Count = 0 Then
'Ceate SQL Connection & Open it
Dim objConn As New SqlConnection("Data Source=")
objConn.Open()
'Create a command object for the stored proc
Dim objCmd As New SqlCommand("a_", objConn)
objCmd.CommandType = Data.CommandType.StoredProcedure
objCmd.CommandText = "a_"
objCmd.Parameters.Add(New SqlParameter("@headline", Data.SqlDbType.VarChar, 255))
objCmd.Parameters("@headline").Value = txtheadline.Text
objCmd.Parameters.Add(New SqlParameter("@Name", Data.SqlDbType.VarChar, 100))
objCmd.Parameters("@Name").Value = "none.gif"
objCmd.ExecuteNonQuery()
objConn.Close()
Response.Redirect("page.aspx")
Else
For Each f As UploadedFile In RadUpload1.UploadedFiles
f.SaveAs("C:\folder\" & f.GetName, True)
Next
For Each file As UploadedFile In RadUpload1.UploadedFiles
Dim bytes(file.InputStream.Length) As Byte
file.InputStream.Read(bytes, 0, file.InputStream.Length)
'Ceate SQL Connection & Open it
Dim objConn As New SqlConnection("Data Source=")
objConn.Open()
'Create a command object for the stored proc
Dim objCmd As New SqlCommand("a_", objConn)
objCmd.CommandType = Data.CommandType.StoredProcedure
objCmd.CommandText = "a_"
objCmd.Parameters.Add(New SqlParameter("@headline", Data.SqlDbType.VarChar, 255))
objCmd.Parameters("@headline").Value = txtheadline.Text
objCmd.Parameters.Add(New SqlParameter("@Name", Data.SqlDbType.VarChar, 100))
objCmd.Parameters("@Name").Value = file.GetName
objCmd.ExecuteNonQuery()
objConn.Close()
Response.Redirect("page.aspx")
Next
End If
----------------------------------
Thanks in advance
J