15,891,943 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by maheshk_blr (Top 22 by date)
maheshk_blr
27-Jul-11 2:05am
View
Thanks
maheshk_blr
27-Jul-11 2:05am
View
Thanks
maheshk_blr
1-Jul-11 1:51am
View
I want the mainclass object where item.IsC == "Y", not the item object and it should give me only items where item.IsC == "Y" in the main class object, is that possible?
maheshk_blr
1-Jul-11 1:42am
View
I want to know from which mainclass object, Item came. I dont want only items, I need the full object with required items, I am not able to do that
maheshk_blr
29-Jun-11 1:04am
View
Thanks for a nice explanation
maheshk_blr
28-Jun-11 10:06am
View
No, I am reading the date from database, which comes in (dd-mm-yyyy) format, I need to convert that to (MM/dd/yyyy) format, I am reading the data from database using Oracle data reader and date is stored as a string in db.
maheshk_blr
28-Jun-11 9:52am
View
This works but problem is it does not change the date separator, my incoming date contains - as date separator(dd-mm-yyyy), I need / as date separator(MM/dd/yyyy).
Can u please help in this?
maheshk_blr
28-Jun-11 9:05am
View
I am using oracle and reading data using oracle data reader, in DB, date field is varchar2
maheshk_blr
28-Jun-11 9:02am
View
I am using OracleDataReader and not sure whether I can get string from that.
maheshk_blr
17-Jun-11 8:37am
View
Thanks for the explanation, I was getting below error when I was trying with append child method, "The node to be removed is not a child of this node".
I will try with your suggestion again.
maheshk_blr
17-Jun-11 7:37am
View
Thanks, It solved my problem
maheshk_blr
17-Jun-11 7:29am
View
Thanks for your answer.
Is it possible to do this using XMLDocument? because I am doing some other operations with this xml using xmldocument and would like to have my xml in a single object (if possible)
maheshk_blr
1-Mar-11 7:52am
View
I can do that, but If tomorrow any xml tag name changes then I need to modify the c# code.
If I do with XSLT, I can just change the tag name in XSLT and dont need to change the C# code.
That is the reason, I want to use the XSLT.
maheshk_blr
1-Mar-11 4:07am
View
Thanks, nice approach
maheshk_blr
7-Feb-11 5:19am
View
Thanks,
Below is my scenario, in which I needed the above. If you can suggest me some better way, please
I am getting an XML file form a source (assume it is a folder), which I need to validate against an XSD file, I am using below code to do that.
List<string> arrerrors = new List<string>();
XDocument doc = XDocument.Load("My XML Path");
XmlSchemaSet schemas = new XmlSchemaSet();
schemas.Add(null, "My XSD Path");
bool errors = false;
doc.Validate(schemas, (o, e) => {
arrerrors.Add(e.Message);
errors = true;
});
Please note that my XSD has a namespace, which XML does not have and I am trying to manually add it (for that I have asked the above question). If I dont add the namespace to XML, XDocument.Validate() fails to validate the xml. after manually adding the namespace to XML I am getting the xml validated against the XSD.
Since I am very new to XML and XSD, I am not very sure whether my approach is good or not.
Can u please suggest?
Thank you very much for your time and help.
maheshk_blr
4-Feb-11 4:39am
View
Thanks, this helped me to resolve my problem, below is the code I have written.
XDocument doc = XDocument.Load(My XML File Path);
XElement rootElement = doc.Element(doc.Root.Name);
XAttribute att = new XAttribute("xmlns", "Namespace name");
XAttribute att1 = new XAttribute("xmlns", "");
rootElement.Add(att);
XElement[] allElements = doc.Elements().ToArray();
foreach (XElement ele in allElements.Nodes()) {
ele.Add(att1);
}
StringWriter sw = new StringWriter();
XmlTextWriter xtw = new XmlTextWriter(sw);
doc.WriteTo(xtw);
MessageBox.Show(sw.ToString());
I would like to remove foreach from the above code segment, yet achieve the same results, is that possible?
maheshk_blr
17-Jan-11 3:59am
View
Thanks, I tried your solution, but getting below error.
"The 'http://www.w3.org/2001/XMLSchema:all' element is not supported in this context"
maheshk_blr
13-Jan-11 4:38am
View
The errors variable just tells whether the xml got validated against the xsd or not.
The value of errors variable changes to true in this case, but I want the full error message.
maheshk_blr
30-Dec-10 0:05am
View
Thanks for a very nice answer
maheshk_blr
30-Dec-10 0:03am
View
Thanks
maheshk_blr
28-Dec-10 8:06am
View
I only know, How to send automatic emails using 'MailMessage' object, I have no idea of working with .eml templates.
maheshk_blr
20-Dec-10 4:56am
View
Thank you very much for a very nice explanatory answer.
Show More