4 Replies - 914 Views - Last Post: 06 December 2012 - 08:52 PM Rate Topic: -----

#1 GR_UNGE  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 05-December 12

How to insert data from xml to dataset.xsd ?

Posted 05 December 2012 - 09:49 PM

I have problem for this project,please give me solution,
Couse after i count this row, the value always zero.

Is This A Good Question/Topic? 0
  • +

Replies To: How to insert data from xml to dataset.xsd ?

#2 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: How to insert data from xml to dataset.xsd ?

Posted 05 December 2012 - 09:54 PM

View PostGR_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.

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.
Was This Post Helpful? 0
  • +
  • -

#3 GR_UNGE  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 05-December 12

Re: How to insert data from xml to dataset.xsd ?

Posted 05 December 2012 - 11:12 PM

View Postlar3ry, on 05 December 2012 - 09:54 PM, said:

View PostGR_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.

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 ?


View PostGR_UNGE, on 05 December 2012 - 11:10 PM, said:

View Postlar3ry, on 05 December 2012 - 09:54 PM, said:

View PostGR_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.

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 ?

Was This Post Helpful? 0
  • +
  • -

#4 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

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:
<?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?
Was This Post Helpful? 0
  • +
  • -

#5 GR_UNGE  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 05-December 12

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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1