in a web application, i want to insert the XML file content into an access database, i got the code (below), but there is an error with this line
xmlFile = XmlReader.Create("Product.xml", New XmlReaderSettings())
this error appear

please take a look at the code below and tell me how to modify to get the “product.xml” from the web application root folder. i tried “~/product.xml” and it did not work
Imports Microsoft.VisualBasic
Imports System.Xml
Imports System.Data.OleDb
Imports System.Data
Public Class Form1
Public Shared Sub mimi()
Dim connetionString As String
Dim connection As OleDbConnection
Dim command As OleDbCommand
Dim ds As New DataSet
Dim xmlFile As XmlReader
Dim sql As String
Dim adpter As New OleDbDataAdapter
Dim product_ID As Integer
Dim Product_Name As String
Dim product_Price As Double
connetionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= |datadirectory|CRF.mdb;Persist Security Info=True"
connection = New OleDbConnection(connetionString)
xmlFile = XmlReader.Create("Product.xml", New XmlReaderSettings())
ds.ReadXml(xmlFile)
Dim i As Integer
connection.Open()
For i = 0 To ds.Tables(0).Rows.Count - 1
product_ID = Convert.ToInt32(ds.Tables(0).Rows(i).Item(0))
Product_Name = ds.Tables(0).Rows(i).Item(1)
product_Price = Convert.ToDouble(ds.Tables(0).Rows(i).Item(2))
sql = "insert into Product values(" & product_ID & ",'" & Product_Name & "'," & product_Price & ")"
command = New OleDbCommand(sql, connection)
adpter.InsertCommand = command
adpter.InsertCommand.ExecuteNonQuery()
Next
connection.Close()
End Sub
End Class
try to use HttpContext.Current.Server.MapPath(“~/Product.xml”)