Upload image to MS Access database (.mdb) in ASP.Net

Last Reply 3 months ago By dharmendr

Posted 3 months ago

how to upload image to ms access 

Partial Class package1
Inherits System.Web.UI.Page
Dim con As New OleDbConnection

Protected Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim myConn As OleDbConnection
Dim cmd As OleDbCommand
Dim sqlString, PackageID, PackageName, PackageDescription, PackageImage As String
Dim FileUpload1


PackageImage = FileUpload1
PackageID = TextBox1.Text
PackageName = TextBox2.Text
PackageDescription = TextBox3.Text

myConn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & Server.MapPath("Tour.mdb"))

myConn.Open()

sqlString = "INSERT INTO Package (PackageID, PackageName, PackageDescription, PackageImage) VALUES ('" + TextBox1.Text + "', '" + TextBox2.Text + "', '" + TextBox3.Text + "');"
cmd = New OleDbCommand(sqlString, myConn)
cmd.ExecuteNonQuery()

 


Posted 3 months ago

I dont know how what is the sql query for image


Posted 3 months ago

Please refer the answered reply link provided in the link and read the solution provided.