I have the following code and I am looking to insert the image file to my sql database that has been unploaded to azure storage.

  • Thread starter Thread starter eruig
  • Start date Start date
E

eruig

Guest
Private Async Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click

Try
ToolStripStatusLabel1.Text = "Uploading"
Await Task.Delay(txtDelay.Text)

Dim AZBlob As New AzureBlob(ConfigurationManager.AppSettings(StorageConnectionString), mycontainer)

Await AZBlob.UploadAsync(PictureBox1.ImageLocation, cancelToken)


'---Insert in SQL Table using PictureBox1.ImageLocation
my table has the columns:
Id
FileUrl
FileData
OriginalName
ContentType
DateCreated






ToolStripStatusLabel1.Text = ""
PictureBox1.Image = Nothing
Catch exCancel As OperationCanceledException
Dim message As String = "upload canceled at Form"
MessageBox.Show(message)
ToolStripStatusLabel1.Text = message
Catch ex As Exception
MessageBox.Show(ex.Message)
ToolStripStatusLabel1.Text = ex.Message
End Try
End Sub

Continue reading...
 
Back
Top