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
Enos
NA
140
26.6k
How do i write resource file and also be created on xml?
Feb 3 2015 5:15 AM
Hi,
I have resource file which the user browse the file and it get loaded on the Gridview. now i want to write the new line on the grid and click save so that it must be added on xml. Below are my code for reading xml file. i have tried to write but i didn't get it working;
private void btnBrowse1_Click(object sender, EventArgs e)
{
try
{
BrowseFile();
versionIncrement();
if (txtInputfile.Text.Length > 0)
{
PathSelection = txtInputfile.Text;
}
oDataSet = new DataSet();
XmlReadMode omode = oDataSet.ReadXml(PathSelection);
for (int i = 0; i < oDataSet.Tables[2].Rows.Count; i++)
{
string comment = oDataSet.Tables["data"].Rows[i][2].ToString();
string[] elements = comment.Split('-');
string font = elements[0];
string datestamp = elements[1];
string commentVal = elements[2];
string[] row = new string[] { oDataSet.Tables["data"].Rows[i][0].ToString(), oDataSet.Tables["data"].Rows[i][1].ToString(), font, datestamp, commentVal };
Gridview_Input.Rows.Add(row);
}
}
Reply
Answers (
0
)
Sending SMS in C#
I would like to add code for error detection in this code,