Tableau - Récupération de données SQL

Muintyr Messages postés 24 Date d'inscription vendredi 28 mars 2003 Statut Membre Dernière intervention 30 novembre 2006 - 21 nov. 2006 à 09:50
SuperBouly Messages postés 410 Date d'inscription dimanche 1 février 2004 Statut Membre Dernière intervention 8 mai 2010 - 21 nov. 2006 à 11:32
Bonjour !

je me met à asp.net et j'ai un petit problème quant à la récupération des données de ma base

Avant, dans ASP, je procédais ainsi :

---------------------------------------------------------
strsql1="select table.champ1, table2.champ1, table2.champ3, table.champ2, table2.champ4 from table2" _
 & " inner join table on table.champ1=table2.champ2 " _
 & " where table.champ1 like '%qqch%' and table2.champ2=2003"



set rs1=server.createobject("Adodb.recordset")
rs1.open strsql1, cn
  
 if rs1.eof <> true then
 do while not rs1.eof
  val2003A=rs1("champ3")

      response.Write((val2003A) & "K?") %>
       

        <% rs1.movenext%>
        <% loop
 end if
 rs1.close
 set rs1 =nothing



 %>
--------------------------------------------------------------------------------

Sur ASP.net, j'ai un truc de ce style :

         Function MyQueryMethod() As System.Data.DataSet
             Dim connectionString As String = "server='serv-sql'; trusted_connection=true; database='EUDO_TEST'"
             Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)
   
             Dim queryString As String
             Dim dbCommand As System.Data.IDbCommand
             Dim dataAdapter As System.Data.IDbDataAdapter
             Dim dataSet As System.Data.DataSet= New System.Data.SqlClient.SqlCommand
   
   
             querystring= "select table.champ1, table2.champ1, table2.champ3, table.champ2, table2.champ4 from table2" _
 & " inner join table on table.champ1=table2.champ2 " _
 & " where table.champ1 like '%qqch%' and table2.champ2=2003"
   
   
             dbcommand= New System.Data.SqlClient.SqlCommand
             dbCommand.CommandText = queryString
             dbCommand.Connection = dbConnection
   
             dataAdapter= New System.Data.SqlClient.SqlDataAdapter
             dataAdapter.SelectCommand = dbCommand
             dataAdapter.Fill(dataSet)
   
             Return dataSet
         End Function
   
    Sub DataList1_SelectedIndexChanged(sender As Object, e As EventArgs)
   
    End Sub
-------------------------------------------------

 Mais je fais comment pour insérer mon response.write dans ma page Internet ????

Je vous remercie par avance !!!

1 réponse

SuperBouly Messages postés 410 Date d'inscription dimanche 1 février 2004 Statut Membre Dernière intervention 8 mai 2010
21 nov. 2006 à 11:32
il faut je crois introduire un dataview du genre (je résume)
dim dv as new dataview
dv.table=mon dataset.tables("matable")
et , si tu veux, response.write(dv("monchamp"))
@+Gilles
0
Rejoignez-nous