ho un problema col data relations, infatti dopo aver effettuato una query a 2 tabelle RELAZIONATE (autori opere, avete già capito la struttura) mi crea il risultato in XML (bene, bello) però se io modifico la query "SELECT * FROM autori WHERE Cognome LIKE'%Calvino%'" ad esempio, udite udite, non accetta il fatto che non vi siano corrispondenze nella tabella "opere", infatti la funzione recupera anche le opere che non appartengono a calvino (lo vedete dalla query)e non sa dove ficcarsele.
ecco il codice.
grazie ecodice:Sub Page_Load(s As Object, e as EventArgs) 'If Not Page.IsPostBack Then Dim where Dim myStrConn = ConfigurationSettings.appSettings("str_conn") Dim myConn as New SqlConnection(myStrConn) Dim myDataSet As New DataSet("autoriopere") If Request.Form("autore") <> "" Then where = " where Cognome LIKE '%" & Request.Form("autore") & "%'" End If Dim autDA As New SqlDataAdapter("SELECT * FROM autori", myConn)' & where & "" autDA.Fill(myDataSet, "autori") Dim opeDA As New SqlDataAdapter("SELECT * FROM opere", myConn) 'WHERE Autore = " & dc1 & " opeDA.Fill(myDataSet, "opere") myConn.Close() myDataSet.Relations.Add("AutOpe", _ myDataSet.Tables("autori").Columns("IDAutore"), _ myDataSet.Tables("opere").Columns("Autore")).Nested = true Dim xmlDoc As XmlDataDocument = New XmlDataDocument(myDataSet) Dim htmlDoc As XmlDataDocument Dim xslTran As XslTransform = New XslTransform xslTran.Load(Server.MapPath("stylesheets/myXmlData.xsl")) 'Dim writer As XmlTextWriter = New XmlTextWriter(Server.MapPath("myXMLData.html"), System.Text.Encoding.UTF8) Dim fs as StringWriter = new StringWriter() xslTran.Transform(xmlDoc, Nothing, fs) Response.Write(fs) Session("sessDs") = myDataSet 'End If End Sub
ciao a tutti...tutti...tuttti (caxxhio ma c'è dell'eco in questo forum!)

) mi crea il risultato in XML (bene, bello) però se io modifico la query "SELECT * FROM autori WHERE Cognome LIKE'%Calvino%'" ad esempio, udite udite, non accetta il fatto che non vi siano corrispondenze nella tabella "opere", infatti la funzione recupera anche le opere che non appartengono a calvino (lo vedete dalla query)e non sa dove ficcarsele.
Rispondi quotando