TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Deepak Pandey
NA
75
0
XML
Jun 7 2010 1:54 PM
hello........
Iam facing problem in XML....
I want to save employee records in XML file using user input....
But when i tried to save the data in XML File ...it is storing only one record ...
try to solve my problem so that i can add multiple records in the XML file..........
by one record i mean that..
i want to save employee details like employee no,employee name, salary and job....
when i tried to save the data.. it saves the record of only one employee...and it replaces the previous saved record ihv used following code to save the data
public void SaveData()
{
dtbl = new DataTable("emp");
dtbl.Columns.Add(new DataColumn("EmpNo",Type.GetType("System.String")));
dtbl.Columns.Add(new DataColumn("EmpName", Type.GetType("System.String")));
dtbl.Columns.Add(new DataColumn("EmpJob", Type.GetType("System.String")));
dtbl.Columns.Add(new DataColumn("EmpSalary", Type.GetType("System.String")));
//DataTable dt = display_data();
if (dtbl.Rows.Count > 0)
{
DataRow r = dtbl.NewRow();
r[0] = txtEmployeeNumber.Text;
r[1] = txtEmployeeName.Text;
r[2] = txtJob.Text;
r[3] = txtSalary.Text;
dtbl.Rows.Add(r);
str = Server.MapPath("XMLEmp.xml");
dtbl.WriteXml(str);
dtbl.AcceptChanges();
lblMsg.Text = "Data Saved";
}
SaveData() is the function which i hv called in btnSave_click
and str is varible of string datatype
now you can solve my problem easily...
Thanks.............
Reply
Answers (
2
)
Session validation problem in Page Load event
why ajax calender need text box