Re: Urgent! code prob writing to XML file

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I got the page to display finally by commenting out the 'catch line.
However when I hit submit I get the error in my browser "Access to the
path 'E:\kunden\homepages\26\d190091667\timeline.xml' is denied. I
caontacted "www.1and1.com" which hosts my site and they said I needed
to reference their server in my code, something like this:

Mail.RemoteHost = "mrelay.perfora.net" ' The mail server you have to
use with Asp Mail

huh????? how can I put this in my code?


On Jun 14, 11:55 am, "PvdG42" <p...@xxxxxxxxxxxxx> wrote:
"slinky" <campbellbrian2...@xxxxxxxxx> wrote in message

news:1181835026.175604.253730@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx





I have an aspx for with a textbox and a button. The goal is to simply
have the user type a message, hit the button and it should append to
the XML file. I can open the aspx in the browser with no problem, but
the XML file does not get updated. What's wrong with this code?
Thanks!

<script runat="server">
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim ds As New DataSet()
ds.ReadXml(Server.MapPath("timeline.xml"))
txtNewEvent.DataBind()
ds.Dispose()
End If
End Sub

Private Sub btnSubmit_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnSubmit.Click
Dim ds As New DataSet()
Try
ds.ReadXml(Server.MapPath("timeline.xml"))
ds.Tables(0).Rows(0).Item("Event") = txtNewEvent.Text
ds.WriteXml(Server.MapPath("timeline.xml"))
Catch
Finally
ds.Dispose()
End Try
End Sub
</script>

Have you tried the AcceptChanges method?

http://msdn2.microsoft.com/en-us/library/system.data.dataset_members....- Hide quoted text -

- Show quoted text -


.



Relevant Pages

  • Re: Integrating browser with excel
    ... Sub tester() ... Dim msxml As New MSXML2.XMLHTTP26 ... browser and communicating it through excel? ...
    (microsoft.public.excel.programming)
  • Re: Renaming multiple sheets
    ... > Dim sh ... but hit a compile error: Sub or Function not defined: ...
    (microsoft.public.excel.worksheet.functions)
  • Re: How to link to text files in datagrid?
    ... The user's browser will look to the local C: ... else under a website where IIS can server them from) and put in a link or ... > Private Sub Page_Load(ByVal sender As System.Object, ... > Dim dtrDataGrid As SqlDataReader ...
    (microsoft.public.dotnet.framework.aspnet)
  • MsgBox OKCancel
    ... I tried to make a message box which pops u when I hit a button. ... Get_Inkoopdelen_Data" when Cancel it has to return to the sheet "Index". ... Sub Bevesiging_ARF_Vullen ... Dim rng As Range ...
    (microsoft.public.excel.misc)
  • Re: Framesets erzeugen
    ... Frams werden vom Browser nicht unterstützt ... Sub Page_Load ... Dim FS_LiRe As New HtmlGenericControl ...
    (microsoft.public.de.german.entwickler.dotnet.asp)