Ver Mensaje Individual
  #24 (permalink)  
Antiguo 21/02/2005, 10:25
Avatar de Sayra
Sayra
 
Fecha de Ingreso: diciembre-2004
Mensajes: 365
Antigüedad: 19 años, 5 meses
Puntos: 1
pues creo que te mande el que no era

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace Rainbow.DesktopModules.Agencia
{
/// <summary>
/// Descripción breve de WebForm11.
/// </summary>
public class WebForm11 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
// Introducir aquí el código de usuario para inicializar la página
}

#region Código generado por el Diseñador de Web Forms
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: llamada requerida por el Diseñador de Web Forms ASP.NET.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Método necesario para admitir el Diseñador. No se puede modificar
/// el contenido del método con el editor de código.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion

Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
Dim ds As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter

ds = New DataSet ()
MyConnection = New SqlConnection("SERVER=MDS01; DATABASE=be; INTEGRATED SECURITY=false;PASSWORD=sa;USER=sa")

MyCommand = New SqlDataAdapter ("select CiudadID, Nombre_Ciudad from Ciudad, where EstadoID"=DropDownList1.SelectedItem.Value, MyConnection)
MyCommand.Fill(ds,"Ciudad")
DropDownList2.DataSource = ds.Ciudad(DropDownList1.SelectedItem.Value)
DropDownList2.DataTextField = "Nombre_Ciudad"
DropDownList2.DataValueField = "CiudadID"
DropDownList2.DataBind()
ds.Cerrar()
ds.Dispose()
End Sub

Private Sub DropDownList2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList2.SelectedIndexChanged
Dim ds As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter

ds = New DataSet ()
MyConnection = New SqlConnection("SERVER=MDS01; DATABASE=be; INTEGRATED SECURITY=false;PASSWORD=sa;USER=sa")

MyCommand = New SqlDataAdapter ("select UbicacionID, Descripción from Ubicacion where CiudadID"= DropDownList2.SelectedItem.Value, MyConnection)
MyCommand.Fill(ds,"Ubicacion")
DropDownList3.DataSource = ds.Ubicacion(DropDownList2.SelectedItem.Value)
DropDownList3.DataTextField = "Descripcion"
DropDownList3.DataValueField = "UbicacionID"
DropDownList3.DataBind()
ds.Cerrar()
ds.Dispose()
End Sub
End Class
}
}
aunque si hago doble clik en la vista diseño sobre algun drop me lleva al que es aspx.cs en c