Forum: VB.NET |
Thema:
TreeView aus Access2000-Tabelle |
Von:
paul meier (
30.01.2005 12:12) |
hi,
ich möchte die Daten aus einerAccess-Tabelle(Artikel.mdb) in einem TreeView abbilden.
Ich hab es mit dem XMLWriter probiert, hab aber irgendwie einen Fehler, so:
Public Sub xml_fill()
'Next, you fill the adapter with data, naming the DataTable "CouponsRedeemed":
Dim xmlds As Data.DataSet
Dim xmloleadp As New OleDb.OleDbDataAdapter
Dim xmlcmd As New OleDb.OleDbCommand("Select * from Artikel", cn)
xmlcmd.CommandTimeout = 30
Dim xmladp As New OleDb.OleDbDataAdapter
xmloleadp.SelectCommand = xmlcmd
cn.Open()
xmladp.Fill(xmlds, "artikel")
cn.Close()
'Now, create an XmlDataDocument to wrap the DataSet. After this, doc is now ready to use, including all the base XmlDocument members:
Dim XmlDataDoc As New XmlDataDocument(xmlds)
'In this case, you can just use an XmlWriter to output the XmlDataDocument to the console:
Dim XmlTextWriter As New XmlTextWriter(Console.Out)
XmlTextWriter.Formatting = Formatting.Indented
XmlDataDoc.WriteTo(XmlTextWriter)
End Sub
Fehlermeldung:
An unhandled exception of type 'System.ArgumentNullException' occurred in system.data.dll
Additional information: Value cannot be null.
Was ist da falsch, bzw.ist das überhaupt der richtige Ansatz über XMLWriter?
Auch hab ich noch keine Idee, wie ich dann die XML-Daten in das Treeview bekomme.
Gruß paul!
www.firmsoftware.de
Betreff |
Von |
Datum |
|
  |
Re: TreeView aus Access2000-Tabelle
Hi Paul,<br><br>hab mir deinen Code angegekuckt und korrigiert. Habe die Fehler in den Zeilen kommentiert. Über das Einfügen in die TreeView mach ich mir später einen Kopf<br><br>Richtiger Code:<br><br>Public Sub... |
 |
 |
 |
|
|
G.
Guest
|
03.02.2005 12:26 |
|
  |
Re: TreeView aus Access2000-Tabelle
Hi Paul, <br><br>du brauchst den XMLWriter nicht. Benutze folgende Methode um deine TreeView zu füllen.<br><br> Public Sub FillMyTreeView(ByVal thisDataSet As DataSet)<br> Dim XMLDocument As... |
 |
 |
 |
|
|
G.
Guest
|
03.02.2005 14:34 |
|
|
paul
meier
|
20.02.2005 18:43 |
|
|
G.
Guest
|
05.03.2005 17:51 |
|
|
Antworten
Vorsicht bei der Eingabe: Die Zeichen ' oder -- sind nicht erlaubt!