I have problem for this project,please give me solution,
Couse after i count this row, the value always zero.
How to insert data from xml to dataset.xsd ?
Page 1 of 14 Replies - 324 Views - Last Post: 06 December 2012 - 08:52 PM
Replies To: How to insert data from xml to dataset.xsd ?
#2
Re: How to insert data from xml to dataset.xsd ?
Posted 05 December 2012 - 09:54 PM
GR_UNGE, on 05 December 2012 - 10:49 PM, said:
I have problem for this project,please give me solution,
Couse after i count this row, the value always zero.
Couse after i count this row, the value always zero.
Did you forget to supply some code? Perhaps some data?
We don't write code for you. We answer questions on specific problems. Please feel free to elaborate on what, exactly, you are having a problem with.
#3
Re: How to insert data from xml to dataset.xsd ?
Posted 05 December 2012 - 11:12 PM
lar3ry, on 05 December 2012 - 09:54 PM, said:
GR_UNGE, on 05 December 2012 - 10:49 PM, said:
I have problem for this project,please give me solution,
Couse after i count this row, the value always zero.
Couse after i count this row, the value always zero.
Did you forget to supply some code? Perhaps some data?
We don't write code for you. We answer questions on specific problems. Please feel free to elaborate on what, exactly, you are having a problem with.
Sorry i have attachemnt file,but not appear.
this is my Problem:
I created a dataset xsd called dataset1.xsd,and xml schema called transaksi.xml
transaksi.xml:
<?xml version="1.0" encoding="Windows-1252"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="DataSet1">
<xs:complexType>
<xs:sequence>
<xs:element name="transaksi">
<xs:complexType>
<xs:sequence>
<xs:element name="kd_trans" type="xs:string" />
<xs:element name="tgl" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
dataset1.xsd:
transaksi |
------------
kd_trans |
tgl |
And this is my code :
Dim stream As System.IO.Stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("transaksi.xml")
dataset11.ReadXml(stream, XmlReadMode.IgnoreSchema)
MsgBox(dsParents11.transaksi.Rows.Count)
Problem:
Why the value is always 0 ?
GR_UNGE, on 05 December 2012 - 11:10 PM, said:
lar3ry, on 05 December 2012 - 09:54 PM, said:
GR_UNGE, on 05 December 2012 - 10:49 PM, said:
I have problem for this project,please give me solution,
Couse after i count this row, the value always zero.
Couse after i count this row, the value always zero.
Did you forget to supply some code? Perhaps some data?
We don't write code for you. We answer questions on specific problems. Please feel free to elaborate on what, exactly, you are having a problem with.
Sorry i have attachemnt file,but not appear.
this is my Problem:
I created a dataset xsd called dataset1.xsd,and xml schema called transaksi.xml
transaksi.xml:
<?xml version="1.0" encoding="Windows-1252"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="DataSet1">
<xs:complexType>
<xs:sequence>
<xs:element name="transaksi">
<xs:complexType>
<xs:sequence>
<xs:element name="kd_trans" type="xs:string" />
<xs:element name="tgl" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
dataset1.xsd:
transaksi |
------------
kd_trans |
tgl |
And this is my code :
Dim stream As System.IO.Stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("transaksi.xml")
dataset11.ReadXml(stream, XmlReadMode.IgnoreSchema)
MsgBox(dataset11.transaksi.Rows.Count)
Problem:
Why the value is always 0 ?
#4
Re: How to insert data from xml to dataset.xsd ?
Posted 06 December 2012 - 12:48 PM
OK... this topic is a bit of a mess, but finally, I managed to get a copy of GR_UNGE's Project. It's here on D.I.C., at xml.zip
His XML file is as follows:
And his code is:
The problem is that the MsgBox shows zero. It looks to me like the xml is not filling in any rows. Of course, I don't use xml or databases much at all, so who am I to say?
Anyone have any ideas?
His XML file is as follows:
<?xml version="1.0" standalone="yes"?>
<DataSet1>
<xs:schema id="DataSet1" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="DataSet1" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="transaksi">
<xs:complexType>
<xs:sequence>
<xs:element name="kd_trans" type="xs:string" minOccurs="0" />
<xs:element name="tgl" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<transaksi>
<kd_trans>TR-1212401</kd_trans>
<tgl>4/12/2012 12:00:00 AM</tgl>
</transaksi>
</DataSet1>
And his code is:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim stream As System.IO.Stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("transaksi.xml")
Dataset11.ReadXml(stream, XmlReadMode.IgnoreSchema) 'IgnoreSchema)
MsgBox(Dataset11.transaksi.Rows.Count)
End Sub
End Class
The problem is that the MsgBox shows zero. It looks to me like the xml is not filling in any rows. Of course, I don't use xml or databases much at all, so who am I to say?
Anyone have any ideas?
#5
Re: How to insert data from xml to dataset.xsd ?
Posted 06 December 2012 - 08:52 PM
ok thanks,,,, i use xml couse i want to make dynamic database. i will try the other way.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|