grazie..
codice:
dim OrdersConnection as OleDbConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& server.mappath("miodb.mdb"))
Dim Adapter As New OledbDataAdapter("Select * from tabella1",ordersconnection)
dim Adapter2 as new OledbDataAdapter("Select tabella1.id, tabella2.campofiglio from tabella1,tabella2 where tabella1.Id=tabella2.rif", OrdersConnection)
Dim MioDataSet As New DataSet()
Adapter.Fill(MioDataSet,"tabella1")
Adapter2.Fill(MioDataSet,"tabella2")
Dim Parent As DataColumn = MioDataSet.Tables("tabella1").Columns("ID")
Dim Child As DataColumn = MioDataSet.Tables("tabella2").Columns("id")
Dim CustomerRelation As DataRelation = New DataRelation("CustomerRelation", Parent, Child, False)
MioDataSet.Relations.Add(CustomerRelation)
DataGrid1.DataSource = MioDataSet.Tables("tabella1").DefaultView
DataBind()
questo è il codice ke ti fa il tutto .. xò ora mi serve una mano su come renderlo adatto a prendere un file xml ..
qualke consiglio?? io leggo il file xml cosi
codice:
Dim ds As New DataSet()
Dim xmldoc as new XmlDataDocument()
xmldoc.Load(Server.MapPath("file.xml"))
Dim stringaXML As String
Dim nodo As XmlNode
Dim lista as XMLNodeList
lista = xmldoc.SelectNodes("root/prova1")
'la tabella prova1 ha come colonne: ID e car1 e car2
for each nodo in lista
stringaXML = nodo.outerXML
ds.ReadXML(new StringReader(stringaXML))
dg1.DataSource = ds.Tables("prova1")
dg1.DataBind()
Next
grazie!!