 
			
				18/02/2005, 03:25
			
			
			     |  
        |     |    |    Fecha de Ingreso: noviembre-2004  
						Mensajes: 2.344
					  Antigüedad: 21 años Puntos: 8     |        |  
  |      Buenas Saira, te paso un código que funciona perfectamente, ok??Es VB.NET, y el objeto bd es una capa (una clase) de acceso a la base de datos, con el connection y tal, y las funciones ObtenerPaises, ObtenerProvincias y ObtenerCiudades, devuelven un datareader, ok??   
en el .aspx:   
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="pormasque.WebForm1"%> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
<HTML> 
	<HEAD> 
		<title>WebForm1</title> 
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1"> 
		<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1"> 
		<meta name="vs_defaultClientScript" content="JavaScript"> 
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> 
	</HEAD> 
	<body MS_POSITIONING="GridLayout"> 
		<form id="Form1" method="post" runat="server"> 
			<asp:DropDownList id="DropDownList1" runat="server" AutoPostBack="True"></asp:DropDownList> 
			<asp:DropDownList id="DropDownList2" AutoPostBack="True" runat="server"></asp:DropDownList> 
			<asp:DropDownList id="DropDownList3" AutoPostBack="True" runat="server"></asp:DropDownList> 
		</form> 
	</body> 
</HTML>         
--En el código, codebehind, o como quieras llamarlo:   
Public Class WebForm1 
    Inherits System.Web.UI.Page   
#Region " Código generado por el Diseñador de Web Forms "   
    'El Diseñador de Web Forms requiere esta llamada. 
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()   
    End Sub 
    Protected WithEvents DropDownList1 As System.Web.UI.WebControls.DropDownList 
    Protected WithEvents DropDownList2 As System.Web.UI.WebControls.DropDownList 
    Protected WithEvents DropDownList3 As System.Web.UI.WebControls.DropDownList   
    'NOTA: el Diseñador de Web Forms necesita la siguiente declaración del marcador de posición. 
    'No se debe eliminar o mover. 
    Private designerPlaceholderDeclaration As System.Object   
    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 
        'CODEGEN: el Diseñador de Web Forms requiere esta llamada de método 
        'No la modifique con el editor de código. 
        InitializeComponent() 
    End Sub   
#End Region   
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 
        'Introducir aquí el código de usuario para inicializar la página 
        If Not IsPostBack Then 
            Dim bd As BD = New BD 
            DropDownList1.DataSource = bd.obtenerPaises() 
            DropDownList1.DataTextField = "Nombre" 
            DropDownList1.DataValueField = "id" 
            DropDownList1.DataBind() 
            bd.Cerrar() 
            bd.Dispose() 
        End If 
    End Sub   
    Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged 
        Dim bd As BD = New BD 
        DropDownList2.DataSource = bd.obtenerProvincias(DropDownList1.SelectedItem.Va  lue) 
        DropDownList2.DataTextField = "Nombre" 
        DropDownList2.DataValueField = "id" 
        DropDownList2.DataBind() 
        bd.Cerrar() 
        bd.Dispose() 
    End Sub   
    Private Sub DropDownList2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList2.SelectedIndexChanged 
        Dim bd As BD = New BD 
        DropDownList3.DataSource = bd.ObtenerCiudades(DropDownList2.SelectedItem.Valu  e) 
        DropDownList3.DataTextField = "Nombre" 
        DropDownList3.DataValueField = "id" 
        DropDownList3.DataBind() 
        bd.Cerrar() 
        bd.Dispose() 
    End Sub 
End Class     
Ya te digo que no da ningun error y carga de p.m. los drops           |