V
Vinícius Pitta Lima de Araújo
Hi,
I have a query return in a XML string. My XML result looks like:
<activities>
<activity>
<subject>Win the Nobel</subject>
<scheduledstart date="01/01/2005"
time="00:00">2005-01-01T00:00:00-3:00</scheduledstart>
</activity>
</activities>
If a dont have the scheduledstart element, the loading of result into a
DataSet works fine, but when I try put the element and associate it with a
column I get a error (something like "field scheduledstart not found").
See my code:
NameTable nt = new NameTable();
XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt);
XmlParserContext context = new XmlParserContext(null, nsmgr, null,
XmlSpace.None);
XmlTextReader tr = new XmlTextReader(strResultsXml, XmlNodeType.Document,
context);
DataSet ds = new DataSet();
ds.ReadXml(tr);
BoundColumn colAssunto = new BoundColumn();
colAssunto.HeaderText = "Assunto";
colAssunto.DataField = "subject";
BoundColumn colInicio = new BoundColumn();
colInicio.HeaderText = "Inicio";
colInicio.DataField = "scheduledstart";
dgResultado.AutoGenerateColumns = false;
dgResultado.Columns.Add(colAssunto);
dgResultado.Columns.Add(colInicio);
dgResultado.DataSource = ds;
if (ds.HasChanges())
dgResultado.DataBind();
How I associate the scheduledstart date and time attributes to two columns
or the content of the element to one column?
Can somebody help me?
Thank you for pay attention and sorry my bad english.
[]'s
Vinícius Pitta Lima de Araújo
I have a query return in a XML string. My XML result looks like:
<activities>
<activity>
<subject>Win the Nobel</subject>
<scheduledstart date="01/01/2005"
time="00:00">2005-01-01T00:00:00-3:00</scheduledstart>
</activity>
</activities>
If a dont have the scheduledstart element, the loading of result into a
DataSet works fine, but when I try put the element and associate it with a
column I get a error (something like "field scheduledstart not found").
See my code:
NameTable nt = new NameTable();
XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt);
XmlParserContext context = new XmlParserContext(null, nsmgr, null,
XmlSpace.None);
XmlTextReader tr = new XmlTextReader(strResultsXml, XmlNodeType.Document,
context);
DataSet ds = new DataSet();
ds.ReadXml(tr);
BoundColumn colAssunto = new BoundColumn();
colAssunto.HeaderText = "Assunto";
colAssunto.DataField = "subject";
BoundColumn colInicio = new BoundColumn();
colInicio.HeaderText = "Inicio";
colInicio.DataField = "scheduledstart";
dgResultado.AutoGenerateColumns = false;
dgResultado.Columns.Add(colAssunto);
dgResultado.Columns.Add(colInicio);
dgResultado.DataSource = ds;
if (ds.HasChanges())
dgResultado.DataBind();
How I associate the scheduledstart date and time attributes to two columns
or the content of the element to one column?
Can somebody help me?
Thank you for pay attention and sorry my bad english.
[]'s
Vinícius Pitta Lima de Araújo