im trying to create a simple form of saving an image as binary data to a db.
i never done work in this area and have never played with 'byte' types
Im working fro a tutorial in C and while converting i keep getting the error 'type 'byte' has no constructors vb.net' on this line:
Dim imgbinarydata As Byte() = New Byte(imglen)
my full code is:
Protected Sub UploadBtn_Click(ByVal sender As Object, ByVal e As EventArgs) Handles UploadBtn.Click
If Page.IsValid Then
Dim imgStream As System.IO.Stream = UploadFile.PostedFile.InputStream
Dim imglen As Integer = UploadFile.PostedFile.ContentLength
Dim imgcontenttype As String = UploadFile.PostedFile.ContentType
Dim imgname As String = txtImgName.Value
Dim imgbinarydata As Byte() = New Byte(imglen)
Dim n As Integer = imgStream.Read(imgbinarydata, 0, imglen)
Dim rowsaffected As Integer = SaveToDB(imgname, imgbinarydata, imgcontenttype)
End If
End Sub
End If
wondered if anyone could help
many thanks