raviprakashg Posted September 18, 2006 Share Posted September 18, 2006 Dear Friendsi am maintaing an logSheet of Lastlogin Details in XML sheet the Sheet contains (tags) Like this<LogSheet> <UserID>SomeID </UserID> <UserName>SomeName </UserName> <LastLogDT>09/15/2006</LastLogDT></LogSheet>My QUS is how to Edit the Date "<LastLogDT>" in XML Sheet when a user logged init is possble?pls replay in detail, if there is any valuable link pls give me this is very urgentthnx to all in advanceraviprakashg Link to comment Share on other sites More sharing options...
aspnetguy Posted September 19, 2006 Share Posted September 19, 2006 how do you want to format the date? Can you be more specific? Link to comment Share on other sites More sharing options...
boen_robot Posted September 19, 2006 Share Posted September 19, 2006 I think (s)he means having the same format and actually having the same XML, but only replace for example "09/15/2006" with "09/19/2006" when the user enters on that date.In any way, the XML save and XSL edit XML demonstrate some ASP methods for changing XML.I can't write a PHP equivalent, but I can tell you that for PHP, you need to use the XML writer, or simply use regular expressions, though I don't reccomend that for large applications. In the end, you'll need to save your file though and I don't know how to do that. Perhaps the XML writer does it. Link to comment Share on other sites More sharing options...
raviprakashg Posted September 20, 2006 Author Share Posted September 20, 2006 OK Thanks a lot, But how to solve in asp.net C#my login page is an ASPX Page, after Successfull Login the Date Should be changed. Link to comment Share on other sites More sharing options...
jesh Posted September 20, 2006 Share Posted September 20, 2006 I haven't touched XML in awhile, but you might be able to use a DataSet: DataSet ds = new DataSet();ds.ReadXml("c:\\xml\\myfile.xml"); Once the data is in the dataset, you can navigate to the appropriate spot in your DataSet to change the value of the date. Once you are ready, you can write back to the xml file: ds.WriteXml("c:\\xml\\myfile.xml"); Navigating through the DataSet may take some work until you determine how .NET parses your XML file.I hope this helps! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now