Re: Urgent! code prob writing to XML file
- From: slinky <campbellbrian2001@xxxxxxxxx>
- Date: Fri, 15 Jun 2007 08:13:18 -0700
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 -
.
- Follow-Ups:
- Re: Urgent! code prob writing to XML file
- From: PvdG42
- Re: Urgent! code prob writing to XML file
- References:
- Urgent! code prob writing to XML file
- From: slinky
- Re: Urgent! code prob writing to XML file
- From: PvdG42
- Urgent! code prob writing to XML file
- Prev by Date: Re: Urgent! code prob writing to XML file
- Next by Date: Re: Urgent! code prob writing to XML file
- Previous by thread: Re: Urgent! code prob writing to XML file
- Next by thread: Re: Urgent! code prob writing to XML file
- Index(es):
Relevant Pages
|