Bonjour.

J'ai VS.NET 2002

Je programme sous XP Pro et les fichiers vont sur un Server 2003. Framwork 1.1.

Je dois absolument faire du code ADO dans un page .ASPX.

J'ai ce code dans la page WEB.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
<%@ Page Language="VB" EnableSessionState="false" aspcompat=true%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//FR">
<HTML>
	<HEAD>
		<title>EssaiProg</title>
		<meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
		<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
		<meta content="VBScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
	</HEAD>
	<body bgProperties="fixed" ms_positioning="GridLayout">
		<%
 
		dim Conn = Server.CreateObject("ADODB.Connection")
		Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\toot.MDB;Persist Security Info=False" 
		Conn.Open
		dim RS = Conn.Execute("Select distinct IDMarque from couverture")
		if RS.EOF and RS.BOF then
 
		else
			do until RS.EOF
 
				LstMarque.items.add(RS("IdMarque"))
				RS.movenext
			loop
		end if
%>
		<form runat="server" ID="Form1">
			<p><asp:label id="Label1" style="Z-INDEX: 101; LEFT: 17px; POSITION: absolute; TOP: 42px" runat="server" Height="24px" Width="63px">Marque :</asp:label>
				<asp:dropdownlist id="LstMarque" style="Z-INDEX: 102; LEFT: 98px; POSITION: absolute; TOP: 45px" runat="server" Height="23px" Width="143px"></asp:dropdownlist>
				<asp:label id="Label2" style="Z-INDEX: 103; LEFT: 18px; POSITION: absolute; TOP: 92px" runat="server" Height="21px" Width="58px">Modele :</asp:label>
				<asp:dropdownlist id="LstModele" style="Z-INDEX: 104; LEFT: 99px; POSITION: absolute; TOP: 91px" runat="server" Height="21px" Width="143px"></asp:dropdownlist><asp:label id="Label3" style="Z-INDEX: 105; LEFT: 18px; POSITION: absolute; TOP: 137px" runat="server" Width="58px">Annee :</asp:label><asp:dropdownlist id="LstAnnee" style="Z-INDEX: 106; LEFT: 97px; POSITION: absolute; TOP: 138px" runat="server" Height="20px" Width="144px"></asp:dropdownlist><asp:label id="Label4" style="Z-INDEX: 107; LEFT: 275px; POSITION: absolute; TOP: 16px" runat="server" Height="27px" Width="67px" Font-Size="X-Large" BackColor="#C0FFFF" ForeColor="#00C000">Démo</asp:label>
				<asp:label id="Label5" style="Z-INDEX: 108; LEFT: 18px; POSITION: absolute; TOP: 187px" runat="server" Height="23px" Width="171px">Date Mise en Service :</asp:label>
				<asp:dropdownlist id="LstMiseServiceJour" style="Z-INDEX: 109; LEFT: 203px; POSITION: absolute; TOP: 186px" runat="server" Height="21px" Width="66px"></asp:dropdownlist>
				<asp:DropDownList id="LstMiseServiceMois" style="Z-INDEX: 110; LEFT: 286px; POSITION: absolute; TOP: 185px" runat="server" Height="20px" Width="66px"></asp:DropDownList>
				<asp:DropDownList id="LstMiseServiceAnnee" style="Z-INDEX: 111; LEFT: 374px; POSITION: absolute; TOP: 187px" runat="server" Height="24px" Width="61px"></asp:DropDownList></p>
		</form>
	</body>
</HTML>
Lorsque je veux remplir LstMarque avec les données venant du Recordset ca affiche ce message d'Erreur :

"Aucun 'ListItemCollection.Add' surchargé accessible ne peut être appelé sans conversion restrictive.
Description : Une exception non gérée s'est produite au moment de l'exécution de la demande Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.

Détails de l'exception: System.Reflection.AmbiguousMatchException: Aucun 'ListItemCollection.Add' surchargé accessible ne peut être appelé sans conversion restrictive. "

je dois absolument remplir le dropdownlist au depart de la page WEB avec les données venant de la BD.

Merci de m'eclairer!

AngelEvil