hi,
I have written the following lines of code to fetch the data from .xml file in C#.Net.
Contents of XML file are as follows:
-
http://schemas.microsoft.com/project">
Project1.xml
CSL
CSL\DarshanK
2006-11-17T17:26:00
2006-11-17T17:28:00
1
2006-11-17T08:00:00
2006-11-17T17:00:00
1
0
2
$
0
1
08:00:00
17:00:00
480
2400
20
0
3
0
0
7
2
0
0
1
0
1
1
1
0
0
1
0
0
0
0
0
0
0
1
2006-11-17T08:00:00
1
1
0
0
0
1984-01-01T00:00:00
1
0
0
-
-
1
Standard
1
-1
-
-
1
0
-
2
1
-
-
08:00:00
12:00:00
-
13:00:00
17:00:00
-
3
1
-
-
08:00:00
12:00:00
-
13:00:00
17:00:00
-
4
1
-
-
08:00:00
12:00:00
-
13:00:00
17:00:00
-
5
1
-
-
08:00:00
12:00:00
-
13:00:00
17:00:00
-
6
1
-
-
08:00:00
12:00:00
-
13:00:00
17:00:00
-
7
0
-
3
John
0
1
-
-
0
0
1
0
2006-11-17T17:26:00
0
0
0
500
2006-11-17T08:00:00
2006-11-17T17:00:00
PT8H0M0S
21
PT8H0M0S
0
0
0
0
0
0
1
1
0
0
0
2006-11-17T08:00:00
2006-11-17T17:00:00
2006-11-17T08:00:00
2006-11-17T17:00:00
0
0
480000
0
0
0
3
0
0
0
0
PT0H0M0S
PT0H0M0S
0
0
PT0H0M0S
PT0H0M0S
PT8H0M0S
PT8H0M0S
0
PT8H0M0S
0
PT0H0M0S
0
0
0
-1
1
1
0
8
0
0
0
0
0
0
0
PT0H0M0S
PT0H0M0S
-
1
1
Task1
0
0
2006-11-17T17:27:00
1
1
1
500
2006-11-17T08:00:00
2006-11-17T17:00:00
PT8H0M0S
7
PT8H0M0S
0
1
0
0
0
0
0
1
0
0
0
2006-11-17T08:00:00
2006-11-17T17:00:00
2006-11-17T08:00:00
2006-11-17T17:00:00
0
0
480000
0
0
0
3
0
0
0
0
PT0H0M0S
PT0H0M0S
0
0
PT0H0M0S
PT0H0M0S
PT8H0M0S
PT8H0M0S
0
PT8H0M0S
0
PT0H0M0S
0
0
0
-1
1
1
0
8
0
0
0
0
0
0
0
PT0H0M0S
PT0H0M0S
-
-
0
0
1
0
0
1
0
0
1
3
PT0H0M0S
PT0H0M0S
PT0H0M0S
PT0H0M0S
PT0H0M0S
PT0H0M0S
PT0H0M0S
0
0
2
0
0
2
0
0
0
0
0
0
0
0
0
0
0
2
0
0
0
0
0
0
PT0H0M0S
PT0H0M0S
2006-11-17T17:26:00
-
1
1
John
1
0
J
0
1
1
0
1
3
PT8H0M0S
PT8H0M0S
PT0H0M0S
PT0H0M0S
PT8H0M0S
PT0H0M0S
PT0H0M0S
0
0
2
0
0
2
0
0
0
0
0
0
480000
0
0
0
0
3
0
0
0
0
0
0
PT0H0M0S
PT0H0M0S
2006-11-17T17:27:00
-
-
1
1
1
0
0
0
PT0H0M0S
PT0H0M0S
0
0
0
0
0
0
0
2006-11-17T17:00:00
0
480000
1
0
0
7
0
0
0
0
PT0H0M0S
PT8H0M0S
0
0
PT0H0M0S
PT8H0M0S
0
2006-11-17T08:00:00
2006-11-17T08:00:00
2006-11-17T08:00:00
0
1
0
0
PT8H0M0S
0
0
0
0
PT0H0M0S
PT0H0M0S
2006-11-17T17:27:00
-
1
1
2006-11-17T08:00:00
2006-11-17T17:00:00
2
PT8H0M0S
====================================================================
And for Fetching this Data from this file I have written code lines as below in C#.Net.
Problem is with XQUERY.I tried out all sort of query to fetch the data of Task assigned to perticular Resource.I just need that XQUERY for XPATH.
So will anybody help me to fetch the data?
Dataset objDS=new Dataset();
XmlDataDocument objXMLDoc = new XmlDataDocument(objDS);
//PRoblem lies in XQUERY
XmlNodeList objXMLNodeList = objXMLDoc.DocumentElement.SelectNodes("*");
DataRow dataRow;
stringBuilder.AppendLine("");
foreach (XmlNode xmlNode in objXMLNodeList)
{
dataRow = objXMLDoc.GetRowFromElement((XmlElement)xmlNode);
if (dataRow != null)
{
string str = objXMLNodeList[0].OuterXml;
stringBuilder.Append(str);
}
}
You can reply me on [email protected],[email protected]
Posted Jul 31, 2008, 3:58 AM
Hi,
i send you an application on your mail id
while you run this app it throw an exception forget about that its a data base error
if you have any query tell me