Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6795065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:17:52+00:00 2026-05-26T18:17:52+00:00

in a web application, i want to insert the XML file content into an

  • 0

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

enter image description here

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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:17:53+00:00Added an answer on May 26, 2026 at 6:17 pm

    try to use HttpContext.Current.Server.MapPath(“~/Product.xml”)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want my web application users to download some data as an Excel file.
I'm quite frustrated. I want to be able to insert into my database names
I have this PHP web application. It has a link to an XML file
I want to write a web application and want to use Ruby. I have
I'm developing a web application I want to use the role authentication to control
I'm building an as3 only web application and want to be able to include
I have a .Net web application that I want to take a copy of
I have a web application that I want to run some system tests on,
I have a web application that I want to sync with Flickr. I don't
I have an ASP.NET web application and I want to be able to take

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.