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

Last Reply one year ago By dharmendr

Posted one year 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"))


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


You are viewing reply posted by: dharmendr one year ago.