|
What langauge?
If .net then set the formatting option in the XmlTextWriter class.
XmlTextWriter w = new XmlTextWriter(Console.Out);
w.Formatting = Formatting.Indented;
This is from the MSDN library.
"Every new day begins with possibilities. It's up to us to fill it with things that move us toward progress and peace.” (Ronald Reagan)
|
|
|
|
|
hi i have an xml file...it is having structure like following
<node1>
<node2/>
<node3/>
<node4>
<node5/>
<node6/>
</node4>
<node7/>
</node1>
now what i want is that i create a datagrid wherein each column would be represented by nodes 2 to 7.....so that user can fill in the data for each column...and then on submit all the data gets transferred into innertexts of the respective element in in the xml file.............to summarize,i am trying to provide a user interface for filling in the innertext of an xml document......i need to do it urgently ..please help
-- modified at 8:32 Friday 7th April, 2006
|
|
|
|
|
Hi there,
Iam newbie for c# i like to know how we can load an xml file and read the node inside the xml file earlier my application use to call another appl to get txt file and read the node inside the text file. now i want to pass the xml file instead of the appl so the following are the existing code pls advice how i can do it
Crosswalk_Holdings.Holdings ObjHoldings = new Crosswalk_Holdings.Holdings();
string strresponse ="";
string strMarctxt = "";
XmlNode ObjMarcTxtNode;
//by me 8/2/06
//strresponse = ObjHoldings.SendReceiveXML("http://203.78.8.89/scripts/vista/usmarc11.pl",strBIDNoForHoldings);
XmlDocument ObjXMLHoldings = new XmlDocument();
ObjMarcTxtNode = ObjXMLHoldings.SelectSingleNode("//USMARC/TXT");
if(ObjMarcTxtNode!=null)
{
if (ObjMarcTxtNode.InnerText.Trim()!="")
strMarctxt=Server.HtmlEncode(ObjMarcTxtNode.InnerText);
}
if (strMarctxt !="")
{
string tmpspace = "\n" + " ";
strMarctxt= strMarctxt.Replace(tmpspace, " ");
string strControlNo = ObjHoldings.ParseXML("008 |", strMarctxt).ToString();
if (strControlNo.Trim()!="")
strRecLanguage= strControlNo.Substring(35,3);
string strNativeDelimiter = " ";
//Native Identifier
//ISBN
string strNativeISBN = ObjHoldings.Parse880XML("|020-",strMarctxt).ToString();
//'ISSN
string strNativeISSN = ObjHoldings.Parse880XML("|022-",strMarctxt).ToString();
if (strNativeISBN.Trim()!="" || strNativeISSN.Trim()!="")
{
strNativeIdentifier = (strNativeISBN.Trim().Length>0?strNativeISBN + strNativeDelimiter:"") + strNativeISSN.Trim();
strNativeIdentifier = strNativeIdentifier.Replace("|","");
}
pls advice how i can pass the xml file instead of the url and get info or tag 020 and 022 from the xml file.
we have tag 020 and 022 in the xml file.pls advice
|
|
|
|
|
i need a simple code to convert the rss feeds into asp page..
RaJ
|
|
|
|
|
Hello,
I've been having problems showing the images in my xml file. I can show the first image (kopf_ap.jpg) no prob, but it doesn't change when the other labels are bound/shown in their appropriate label.
Thanks for any help! I've been stuck for a while on this one... :S
//Bind the labels.
ca_bildurl.Image = new Bitmap(System.IO.Path.Combine(root,drv.Row["ca_bildurl1"].ToString()));
ca_titel.DataBindings.Add("Text",dt,"ca_titel");
ca_alter.DataBindings.Add("Text",dt,"ca_alter");
ca_sex.DataBindings.Add("Text",dt,"ca_sex");
burl.DataBindings.Add("Text",dt,"ca_bildurl1");
}
XML Snippet
------------------------------------------------
<fragenkatalog>
<ca_id>4</ca_id>
<ca_titel>head ap</ca_titel>
<ca_bildurl1>kopf_ap.jpg</ca_bildurl1>
<ca_disabled>0</ca_disabled>
<ca_alter>999</ca_alter>
<ca_sex>unknown sex</ca_sex>
</fragenkatalog>
<fragenkatalog>
<ca_id>7</ca_id>
<ca_titel>head occipital</ca_titel>
<ca_bildurl1>kopf_occi.jpg</ca_bildurl1>
<ca_disabled>0</ca_disabled>
<ca_alter>999</ca_alter>
<ca_sex>unknown sex</ca_sex>
</fragenkatalog>
|
|
|
|
|
Programmatically adding TabPage Contents into DataGrid from XML File
Hi,
We are creating a C# Windows application using VS 2005.
It reads in an xml file and creates tab pages that each
have a datagrid that holds the specific information
for that tab's node.
We have been able to programmatically give the tab.text
(the label on the tabs), but when we try to add the
specific data for each tab into a datagrid on the
tab's page, all of the data gets added instead of the
data for just that node.
Perhaps we need to clear the grid first???
Any help would be appreciated.
Thank you in advance,
Anne
Here is a portion of the xml file we are using.
<?xml version="1.0" encoding="utf-8"?>
<inspection>
<inspforms>
<inspform>
<name>general</name>
<sections>
<section>
<tab>Heading</tab>
<label>
<name>id</name>
<type>text</type>
<value>
<single>200621</single>
</value>
</label>
<label>
<name>request
</name>
<type>text
</type>
<value>
<single>30
</single>
<choices>
<choice>
</choice>
</choices>
</value>
</label>
</section>
</sections>
</inspform>
<inspform>
<name>Risk</name>
<sections>
<section>
<tab>Operations</tab>
<label>
<name>Business Type</name>
<type>radio</type>
<value>
<choices>
<choice>
<choicename>Corporation</choicename>
<choicevalue>
</choicevalue>
</choice>
<choice>
<choicename>LLC</choicename>
<choicevalue>
</choicevalue>
</choice>
<choice>
<choicename> Partnership</choicename>
<choicevalue>
</choicevalue>
</choice>
<choice>
<choicename>Sole Proprietor</choicename>
<choicevalue>
</choicevalue>
</choice>
</choices>
</value>
</label>
<label>
<name>Years in Business</name>
<type>text</type>
<value>
<single>
</single>
</value>
</label>
</section>
</sections>
</inspform>
</inspforms>
</inspection>
Here is the pertinent code:
//frmMain.cs
<br />
using System;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Windows.Forms;<br />
<br />
using ABC.Components;<br />
using ABC.Globals;<br />
<br />
namespace ABC.Forms<br />
{<br />
public class frmMain : System.Windows.Forms.Form<br />
{<br />
public const string Path = @"C:\ABCXmls\abcBase.xml";<br />
public ArrayList ArrayListTabs;<br />
<br />
private ABC.Components.abcTabArea abcTabArea1;<br />
<br />
private System.ComponentModel.Container components = null;<br />
<br />
public frmMain()<br />
{<br />
<br />
XmlHelper.OpenFile(Path);<br />
ArrayListTabs = new ArrayList();<br />
ArrayListTabs = XmlHelper.GetArrayList("tab");<br />
InitializeComponent();<br />
}<br />
#region InitializeComponent()<br />
<br />
private void InitializeComponent()<br />
{<br />
...<br />
<br />
}<br />
#endregion<br />
<br />
[STAThread]<br />
static void Main() <br />
{<br />
Application.Run(new frmMain());<br />
}<br />
<br />
private void frmMain_Load(object sender, EventArgs e)<br />
{<br />
this.abcTabArea1.CreateTabs(this.ArrayListTabs, Path);<br />
}<br />
<br />
protected override void Dispose( bool disposing )<br />
{<br />
...<br />
}<br />
<br />
<br />
}<br />
}<br />
}<br />
//xmlHelper.cs
<br />
using System;<br />
using System.Collections;<br />
using System.Data;<br />
using System.IO;<br />
using System.Xml;<br />
<br />
<br />
namespace ABC.Globals<br />
{<br />
public class XmlHelper<br />
{<br />
private static XmlDocument XmlDocument1;<br />
<br />
public static void OpenFile(string path)<br />
{<br />
XmlDocument1 = new XmlDocument();<br />
XmlDocument1.PreserveWhitespace = false;<br />
XmlDocument1.Load(path);<br />
}<br />
public static ArrayList GetArrayList(string elementName)<br />
{<br />
ArrayList arrayList1 = new ArrayList();<br />
<br />
XmlNodeList xmlNodeList1 = XmlDocument1.GetElementsByTagName(elementName);<br />
<br />
for (int idx = 0; idx < xmlNodeList1.Count; idx++) <br />
{<br />
XmlElement xmlElement1 = (XmlElement) xmlNodeList1[idx];<br />
arrayList1.Add(xmlElement1.InnerText);<br />
}<br />
<br />
return arrayList1;<br />
}<br />
}<br />
}<br />
//abcTabArea.cs
<br />
using System;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Windows.Forms;<br />
<br />
namespace ABC.Components<br />
{<br />
public class abcTabArea : System.Windows.Forms.UserControl<br />
{<br />
internal TabControl TabControl1;<br />
internal string Path = "";<br />
<br />
<br />
private System.ComponentModel.Container components = null;<br />
<br />
public jmpBottom()<br />
{<br />
abcTabArea();<br />
}<br />
<br />
#region InitializeComponent()<br />
private void InitializeComponent()<br />
{<br />
...<br />
}<br />
#endregion<br />
<br />
public void CreateTabs(ArrayList arrayListTabNames1, string path)<br />
{<br />
this.Path = path;<br />
for (int idx = 0; idx < arrayListTabNames1.Count; idx++)<br />
{<br />
string tab = "";<br />
tab = arrayListTabNames1[idx].ToString();<br />
<br />
System.Windows.Forms.TabPage abcTabPage = new TabPage(tab);<br />
<br />
abcPage abcPage = new abcPage(tab,this.Path,idx);<br />
<br />
this.abcTabControl1.Controls.Add(abcTabPage);<br />
abcTabPage.Controls.Add(abcPage);<br />
<br />
}<br />
}<br />
<br />
<br />
protected override void Dispose( bool disposing )<br />
{<br />
...<br />
}<br />
<br />
}<br />
}<br />
\\abcPage.cs
<br />
using System;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Windows.Forms;<br />
using System.Xml;<br />
<br />
<br />
namespace ABC.Components<br />
{<br />
<br />
public class abcPage : System.Windows.Forms.UserControl<br />
{<br />
internal string NodeName = "";<br />
internal string Path = "";<br />
internal int indexNum = 0;<br />
private System.Windows.Forms.Panel panel1;<br />
private System.Windows.Forms.DataGrid dataGrid1;<br />
private System.ComponentModel.Container components = null;<br />
<br />
public jmpPage(string nodeName, string path, int indexNum)<br />
{<br />
this.NodeName = nodeName;<br />
this.Path = path;<br />
this.indexNum = indexNum;<br />
InitializeComponent();<br />
Populate();<br />
}<br />
<br />
#region InitializeComponent()<br />
<br />
private void InitializeComponent()<br />
{<br />
this.panel1 = new System.Windows.Forms.Panel();<br />
this.dataGrid1 = new System.Windows.Forms.DataGrid();<br />
this.panel1.SuspendLayout();<br />
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();<br />
this.SuspendLayout();<br />
this.panel1.Controls.Add(this.dataGrid1);<br />
this.panel1.Location = new System.Drawing.Point(0, 0);<br />
this.panel1.Name = "panel1";<br />
this.panel1.Size = new System.Drawing.Size(800, 528);<br />
this.panel1.TabIndex = 0;<br />
this.dataGrid1.DataMember = "";<br />
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;<br />
this.dataGrid1.Location = new System.Drawing.Point(0, 0);<br />
this.dataGrid1.Name = "dataGrid1";<br />
this.dataGrid1.Size = new System.Drawing.Size(800, 528);<br />
this.dataGrid1.TabIndex = 0;<br />
this.Controls.Add(this.panel1);<br />
this.Size = new System.Drawing.Size(800, 528);<br />
this.panel1.ResumeLayout(false);<br />
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();<br />
this.ResumeLayout(false);<br />
<br />
}<br />
#endregion<br />
<br />
internal void Populate()<br />
{<br />
DataSet dataSet1 = new DataSet();<br />
XmlDocument XmlDocument1;<br />
XmlDocument1 = new XmlDocument();<br />
XmlDocument1.PreserveWhitespace = false;<br />
XmlDocument1.Load(this.Path);<br />
<br />
XmlNodeList xmlNodeList = XmlDocument1.GetElementsByTagName("section");<br />
<br />
XmlElement xmlElement1 = (XmlElement) xmlNodeList[this.indexNum];<br />
dataSet1.ReadXml(this.Path);<br />
dataGrid1.DataSource = dataSet1;<br />
dataGrid1.DataMember = "section";<br />
dataGrid1.CaptionText = dataGrid1.DataMember;<br />
}<br />
<br />
protected override void Dispose( bool disposing )<br />
{<br />
...<br />
}<br />
}<br />
}<br />
|
|
|
|
|
I need a .NET windowsform XML editor control for my own application. I search on Internet but i can not find out something.
Please help me.
|
|
|
|
|
Hello everyone.
I am new to VML. I am modifying code I found years ago that I use as a "popup bubble" that moves around the screen displaying information based on the mouseclick. My original code was a small oval with a point poking out of the bottom (you know, like a comic strip). This new project I need the same functionality but a larger rounded rectangle with the point out the bottom. I finally got the shape right but I can't get the FILL COLOR to apply.
Here is page containing the new attempted shape followed by the original:
If anyone can help me fill the shape with 95% opacity yellow I would be eternally greatful.
I'm tired of this simple code spanking me
<HTML xmlns:v="urn:schemas-microsoft-com:vml"
xmlns ="urn:schemas-microsoft-com:office:office">
<HEAD>
<STYLE>
v\:* { behavior: url(#default#VML);}
o\:* { behavior: url(#default#VML);}
</STYLE>
<TITLE>VML Sample</TITLE>
</HEAD>
<BODY>
<div>
<v:group style='position:absolute; top:4; left:4; width:700px; height:700px;'>
<v:stroke joinstyle="miter"/>
<v:arc style='position:absolute; top ; left ; width:20; height:20' filled='true' fillcolor = '#ffeaa1' startangle='270' endangle='360' strokecolor='black' strokeweight='1'/>
<v:line style='position:absolute; top ; left ' from='10,0' to='310,0' strokecolor='black' strokeweight='1'/>
<v:arc style='position:absolute; top ; left:300; width:20; height:20' filled='f' startangle='0' endangle='90' strokecolor='black' strokeweight='1'/>
<v:line style='position:absolute; top ; left ' from='320,10' to='320,130' strokecolor='black' strokeweight='1'/>
<v:arc style='position:absolute; top:120; left:300; width:20; height:20' filled='f' startangle='90' endangle='180' strokecolor='black' strokeweight='1'/>
<v:line style='position:absolute; top ; left ' from='40,140' to='309,140' strokecolor='black' strokeweight='1'/>
<v:line style='position:absolute; top:140; left ' from='40,0' to='0,60' strokecolor='black' strokeweight='1'/>
<v:line style='position:absolute; top ; left ' from='0,200' to='11,140' strokecolor='black' strokeweight='1'/>
<v:arc style='position:absolute; top:120; left ; width:20; height:20' filled='f' startangle='180' endangle='270' strokecolor='black' strokeweight='1'/>
<v:line style='position:absolute; top ; left ' from='0,10' to='0,130' strokecolor='black' strokeweight='1'/>
<v:textbox style='position:absolute; top:10; left:12'><font size="2" face="Arial, Helvetica, sans-serif">This is test text one.<br>This is test text two.<br>Now I can include lots more data in the moving, floating popup information bubble.</SPAN></font></p></v:textbox>
</v:group>
</div>
<div id="callout" style="position:absolute; left:10px; top:200px; width:150px; height:100px; z-index:30; ">
<v:shape coordsize="16000,24000" o:spt="63" adj="1000,25920" path="wr0,,21600,21600@15@16@17@18l@21@22xe" style='position:absolute; margin-left:1pt;margin-top:1pt;width:1in;height:48pt;z-index:17' id="shape" >
<v:fill Color="#ffffcc" Opacity="0.95, 0.95"/>
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="val #0"/>
<v:f eqn="val #1"/>
<v:f eqn="sum 10800 0 #0"/>
<v:f eqn="sum 10800 0 #1"/>
<v:f eqn="atan2 @2 @3"/>
<v:f eqn="sumangle @4 11 0"/>
<v:f eqn="sumangle @4 0 11"/>
<v:f eqn="cos 10800 @4"/>
<v:f eqn="sin 10800 @4"/>
<v:f eqn="cos 10800 @5"/>
<v:f eqn="sin 10800 @5"/>
<v:f eqn="cos 10800 @6"/>
<v:f eqn="sin 10800 @6"/>
<v:f eqn="sum 10800 0 @7"/>
<v:f eqn="sum 10800 0 @8"/>
<v:f eqn="sum 10800 0 @9"/>
<v:f eqn="sum 10800 0 @10"/>
<v:f eqn="sum 10800 0 @11"/>
<v:f eqn="sum 10800 0 @12"/>
<v:f eqn="mod @2 @3 0"/>
<v:f eqn="sum @19 0 10800"/>
<v:f eqn="if @20 #0 @13"/>
<v:f eqn="if @20 #1 @14"/>
</v:formulas>
<v:handles>
<v:h position="#0,#1"/>
</v:handles>
<v:shape style='position:absolute;margin-left:-6pt;margin-top:12pt;width:114pt;height:1in' coordsize="21500,21600" path="m0,0l21600,0m0,21600l21600,21600e" id="Textbox">
<v:textbox>
<p align="center"><font size="2" face="Arial, Helvetica, sans-serif">This is test text one.<br>This is test text two.</SPAN></font></p></v:textbox>
</v:shape>
</v:shape>
</div>
</BODY>
</HTML>
Paul
|
|
|
|
|
I'm sure I am missing something simple here. I have a string in that contains an XML document. I'd like to load that string into a dataset/table to be the source for a datagrid. All the examples I can find assume a) I want to read the XML from a file or b) I'll get it from a sql server using the for xml clause. Neither is true. I already have the data, I just want to get it into the dataset/table.
Any suggestions? The datagrid.readxml function seems to be exactly what I want, except it requires a file or a stream.
There has to be an easy way.
|
|
|
|
|
System.IO.StringReader and System.IO.StringWriter enable you to read from and write to a string as a stream.
|
|
|
|
|
Awesome! That's exactly what I needed. Thanks.
|
|
|
|
|
Hey howzit?
All i wanna do is put some XML in a node and return it thats it. How do I achieve this? Could you provide an example?
-- modified at 7:29 Tuesday 28th March, 2006
|
|
|
|
|
You need to specify a programming language.
-- modified at 23:36 Wednesday 29th March, 2006
|
|
|
|
|
Oh sorry mate, so used to posting on C# forum. I wanna do it in C# please
|
|
|
|
|
XmlDocument xDoc = new XmlDocument();<br />
XmlElement el = xDoc.CreateElement("Root");<br />
el.InnerXml= retXml;
xDoc.AppendChild(el);<br />
return xDoc;
sathy
|
|
|
|
|
Can the < and > characters be used in XML data?
If so how are they written to not be confused as tags?
Thanks
Eric
|
|
|
|
|
You use: &lt; and &gt;
-- modified at 16:36 Tuesday 28th March, 2006
|
|
|
|
|
|
Hi Friends,
I am using XML as database in my application and for datadefinition in xml file I create .xsd file (schema file) and set the target schema property to the .xsd file.
Till that every thing is working fine.
NOw I am trying to export the xml file to msexcel worksheet. and for that I have created an .xslt file which formats data of xml file.
The problem is that the stylesheets works properly only if the xml file is not bind to the schema file. If I bind the xml file to the schema file it give nothing as output and without schema data validation is not possible.
Is there any way to bind schema and stylesheet together?
if any one is having this idea plz let me know.
Thank u all in advance.
Thanks and regards,
Chetan Ranpariya.
|
|
|
|
|
Since your XML file uses a Schema, it has a default namespace. I believe you have to have your XSLT recognize the namespace of the nodes it is transforming.
|
|
|
|
|
Hi George,
Thank you for the reply.
The way u suggest it right but I dont know how to do that?
The xslt file that I had made is like this.
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="1.0" encoding="UTF-8"></xsl:output>
<xsl:template match="/">
<xsl:param name="CompCode"/>
<html>
<body>
<h2>Activities</h2>
<table border="1" cellpadding ="2">
<tr bgcolor="#9acd32">
<th>Sequence Number</th>
<th>Details</th>
</tr>
<xsl:for-each select="CompsAndRels/RelationshipMaster[ProjectCode=$CompCode]">
<xsl:sort select="SequenceNumber" data-type="number"></xsl:sort>
<xsl:variable name="recursive_result"> <xsl:value-of select="RelCode"></xsl:value-of></xsl:variable>
<tr>
<td colspan="2">
<b>
<xsl:value-of select="SequenceNumber"></xsl:value-of>.
<xsl:value-of select="RelDescription"></xsl:value-of></b>
</td>
</tr>
<xsl:for-each select="../ActivityMaster[ActivityRelCode=$recursive_result]">
<xsl:sort select="ActivitySeqNo" data-type="number"></xsl:sort>
<tr>
<td bgcolor="#ffffcc">
<xsl:value-of select="ActivitySeqNo"></xsl:value-of>
</td>
<td bgcolor="#ffffcc">
<xsl:value-of select="ActivityDetail"></xsl:value-of>
</td>
</tr>
</xsl:for-each>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
and My XML file is as following.
<CompsAndRels xmlns="http://tempuri.org/ComponentsAndRelationships.xsd">
<ComponentMaster>
<ComponentCode>35476350</ComponentCode>
<ComponentName>BRUSH</ComponentName>
<ComponentDescription>fa;sl asd.fas dlf;as f.sdf aslj</ComponentDescription>
<ComponentParent>0</ComponentParent>
<ComponentCost>500</ComponentCost>
<CompnentWorth>500</CompnentWorth>
<UserID>mrchetanrana</UserID>
<ProjectCode>5847</ProjectCode>
<ComponentColor>ffffff</ComponentColor>
<ComponentCategory>1220</ComponentCategory>
<EquivalentParent>0</EquivalentParent>
</ComponentMaster>
<RelationshipMaster>
<RelCode>1439936424</RelCode>
<RelTitle>Admin is one type of user</RelTitle>
<RelDescription>User can have role of Admin.</RelDescription>
<RelCompFrom>538826428</RelCompFrom>
<RelCompTo>1616367881</RelCompTo>
<RelType>Initial</RelType>
<CompFunctionCode>321460854</CompFunctionCode>
<UserID>mrchetanrana</UserID>
<ProjectCode>918894685</ProjectCode>
<SequenceNumber>60</SequenceNumber>
</RelationshipMaster>
<ActivityMaster>
<ActivityCode>120787135</ActivityCode>
<ActivitySeqNo>1</ActivitySeqNo>
<ActivityDetail>Enter the Login ID</ActivityDetail>
<ActivityRelCode>889049886</ActivityRelCode>
</ActivityMaster>
</CompsAndRels>
The schema file name is ComponentsAndRelationships.xsd that i have attached with xml file for datavalidation.
Can u suggest me how to put namesapce of this xml file in xslt file?
Thanks again
Chetan Ranpariya.
-- modified at 23:04 Monday 27th March, 2006
|
|
|
|
|
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:car="http://tempuri.org/ComponentsAndRelationships.xsd">
...
Any references to your document (CompsAndRels) must be made through the "car" namespace (car:CompsAndRels).
-- modified at 16:33 Tuesday 28th March, 2006
|
|
|
|
|
Hi All,
In my web application I am using XML as a database. I am using XML schema for data definition. I am using dataset and dataview to retrive datafrom and XML file.
I am doing like following.
Dataset dstDemo = new Dataset();
dstDemo.ReadXMLSchema(MapPath("../Database/File.xsd"));
dstDemo.ReadXML(MapPath("../Database/File.xml"));
DataView dvCustomers = new DataView(dstDemo.Tables["Customers"]);
DataView dvOrders = new DataView(dstDemo.Tables["Orders"]);
Here Tables "Customers" and "Orders" are the two tables at the same level in xml file and both contain "CustomerID" column.
This way I can fetch whole the table from DataSet to DataView and to select some rows from the dataview I am using RowFilter Property of dataview.
dvCustomers.RowFilter = "CustomerCity = 'Bangalore';
dvOrders.RowFilter = "OrderDate = '03/02/2006';
But what if I want only few records from "Orders" Table depending upon "CusotmerIDs" got from the "Customers" table.
I mean how can I use Queries like in SQL with XML files.
Do any one have any idea.
Any type of help will be appriciated.
Thank u all in advance.
Chetan Ranpariya.
|
|
|
|
|
How do i copy a file into another folder in same directory by using XML command. can i replace the latest file into that folder also??
angela
|
|
|
|
|
Just change the pathname to point to the sub-folder. Anyway, what is the run-time context? Are you using ASP.NET, Windows Forms, console, etc.?
|
|
|
|