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

desmond
 
on Jul 02, 2018 02:14 AM
3807 Views

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()

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download
desmond
 
on Jul 02, 2018 03:00 AM

I dont know how what is the sql query for image

dharmendr
 
on Jul 02, 2018 03:06 AM

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