473,386 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Ask something about using XML in asp.net

I am trying to save the xml doc by using asp.net, and i also know how to add
the record.

Dim myDS As New DataSet("Job Information")
If System.IO.File.Exists(Server.MapPath("Hello.xml")) Then
myDS.ReadXml(Server.MapPath("Hello.xml"))

' add record to exist xml document
Dim myDR As DataRow = myDS.Tables("Data").NewRow()
myDR("ID") = txtJobID.Text
myDR("sentences") = txtPosition.Text
myDS.Tables("Data").Rows.Add(myDR)

myDS.WriteXml(Server.MapPath("Hello.xml"))

Else
' add new xml document
Dim myDT As DataTable = myDS.Tables.Add("Data")
myDT.Columns.Add("ID", System.Type.GetType("System.String"))
myDT.Columns.Add("sentences", System.Type.GetType("System.String")
)

Dim myDR As DataRow = myDS.Tables("Data").NewRow()
myDR("ID") = txtJobID.Text
myDR("sentences") = txtPosition.Text
myDS.Tables("Data").Rows.Add(myDR)

myDS.WriteXml(Server.MapPath("Hello.xml"))
End If

But i have a question. If i wanna enter groups of words, like

textbox1.text:(have used multiLine)
Hello world
Hello my friend

that mean i want to break the sentance in 2 line, but in the xml doc, it save
as
<..>Hello worldHello my friend<..>

what can i do in programs so that xml doc can enter in two sentence...
Or using other enter methods can slove this problem?

thanks
Allan
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...p-net/200508/1
Nov 19 '05 #1
0 918

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Ray Godfrey | last post by:
Hi there, Just a simple question, I think. I'm writing a program that takes information from a text file and uses that info to query a DB. Sounds simple enough..... The data would look...
16
by: Bob Rock | last post by:
Hello, when serializing an array of elements of a class Classname using XmlSerializer.Serialize() I get an XML like the following: <?xml version="1.0"> <ArrayOfClassname> ....... ..........
16
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use...
5
by: unwantedspam | last post by:
Hi All, What am I missing. I have trying to create a simple web based application. Basically there are three textboxes and two buttons (Save, Reset). I assume the code behind the save button...
1
by: Dominick Baier | last post by:
Hi, you are right - Windows needs the password in plaintext to impersonate a user (having to call LogonUser, which requires a password). Thinking about it - it is the only way Windows can do it. ...
44
by: Tolga | last post by:
As far as I know, Perl is known as "there are many ways to do something" and Python is known as "there is only one way". Could you please explain this? How is this possible and is it *really* a...
59
by: MotoK | last post by:
Hi Experts, I've just joined this group and want to know something: Is there something similar to smart pointers in C or something to prevent memory leakages in C programs. Regards MotoK
7
by: cj | last post by:
I'm sure it's simple but it's new to me I can dim x as new something which defines x as a new instance of something in one statement. I can also dim x as something then later make x = new...
3
by: Peter Oliphant | last post by:
It's not necessary, but it would be nice if there was a way I could easily create something like a 'web browser form' or a 'display web page form' as forms in my application (in a Panel would be...
10
by: Guillermo_Lopez | last post by:
Hello All, I am using VBA in access to perform some calculations. There is a particular sumation that is wrong (barely). this code is withing a loop. TDist = TDist + TempDist Both TDist...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.