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€") %>
<br />
<% 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 !!!