Je passe par VB
<%@PageLanguage="VB"Debug="true"MasterPageFile="~/Modele.master"Title="" %><%@ImportNamespace="System.Data" %>
<%@ImportNamespace="System.Data.OleDb" %>
<%@ImportNamespace="System.Data.Odbc" %>
<
scriptrunat="server">PublicSub Page_Load(ByVal sender AsObject, ByVal e As EventArgs)
Dim tConnection As OdbcConnection
' Cr,ation de l'objet de connexion
tConnection = New OdbcConnection()
' Ecriture de la cha¼ne de connexion
Dim tConnectionString AsString
tConnectionString = "DATABASE=bddisques;DSN=myodbc;OPTION=0;PORT=0;SERVER=localhost;UID=root"
tConnection.ConnectionString = tConnectionString
' Traitement des op,ration . effectuer sur la base de donn,es
Dim AdoCommand As OdbcCommand = New OdbcCommand
Dim test AsString
test = Request.QueryString("photo")
test = CInt(test)
AdoCommand.CommandText = "SELECT bddisques.tblphotos.* FROM bddisques.tblphotos WHERE bddisques.tblphotos.Id_photo =" & test
AdoCommand.Connection = tConnection
Dim mySqlDataAdapter As OdbcDataAdapter = New OdbcDataAdapter
mySqlDataAdapter.SelectCommand = AdoCommand
mySqlDataAdapter.SelectCommand.Connection.Open()
Dim ClassDS As DataSet = New DataSet
mySqlDataAdapter.Fill(ClassDS, "Ads")
FormView3.DataSource = ClassDS.Tables("Ads")
FormView3.DataBind()
tConnection.Close()
EndSub
</
script>