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
sathish ranga
NA
4
15.5k
C# and xml Updation
Oct 23 2012 3:41 AM
I am new to C# i am updating xml Data with new fields. Those fields are not updated in my xml file. In my Application it is showing Updated successfully, but it in xml file i didn't find any modifications...
#region UpdateCountry method defination
public void UpdateCountry()
{
Image myimg = Image.FromFile(_strLargePath);
Bitmap myBitmapLarge = new Bitmap(myimg, 64, 64);
string strFileLarge = string.Format(@"..\..\imageLarge\{0}", Path.GetFileName(_strLargePath));
//Store Large Image File In Desire Folder
myBitmapLarge.Save(strFileLarge);
//Convert those image into 40 * 40 format
Bitmap myBitmapSmall = new Bitmap(myimg, 40, 40);
//store it into Desired Small Image folder
string strFileSmall = string.Format(@"..\..\imageSmall\{0}", Path.GetFileName(_strLargePath));
myBitmapSmall.Save(strFileSmall);
dsXMlData.Tables[0].DefaultView.RowFilter = string.Format("Name='{0}'", txtCountryName.Text);
string[] strColArr = new string[] { "CapitalCity", "Currency", "Population", "NatLanguage", "LargeImgPath", "SmallImgPath"};
string[] strValArr = new string[]
{txtCapitalCity.Text,txtCurrency.Text,txtPopulation.Text,
txtLangualge.Text,strFileLarge,strFileSmall};
DataRow drTemp = dsXMlData.Tables[0].DefaultView.ToTable().Rows[0];
//Updation Starts here
drTemp.BeginEdit();
for (int intindex = 1; intindex < strColArr.Length; intindex++)
{
drTemp[strColArr[intindex]] = strValArr[intindex];
}
drTemp.EndEdit();
dsXMlData.AcceptChanges();
//Updation complete
dsXMlData.WriteXml(@"..\..\Countries.xml");
MessageBox.Show("Updated Successfully");
// LoadXMlData();
}
#endregion
Reply
Answers (
0
)
can I use asp.net cache in windows forms applications?
SQL query to get a value