Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
560
ALEJANDRO GARCIA
posted

 

I have a ultracombot control with 3 columns (Id, Nombre, Postal)
Dim ClinicasTb As DataTable
Dim bindingManager As BindingManagerBase
ClinicasTb = CargaClinicas()
 Me.ClinicaCbx.DataSource = Me.ClinicasTb

        Me.ClinicaCbx.DataMember = ""
        Me.ClinicaCbx.ValueMember = "id"
        Me.ClinicaCbx.DisplayMember = "nombre"
        Me.ClinicaCbx.LimitToList = True
        Me.ClinicaCbx.MinDropDownItems = 5
        Me.ClinicaCbx.MaxDropDownItems = 10
  TABLE = CargaPacientes(Order, "")
        bindingManager = Me.BindingContext(TABLE)
Me.ClinicaCbx.DataBindings.Add("value", TABLE, "clinica")

  Public Function CargaClinicas() As DataTable
        Dim CLINICAS As New DataTable
        Dim MyConexion As OdbcConnection = New OdbcConnection(StrCon)
        Dim Sql As String
       
            Sql = "Select id, nombre, postal FROM CLINICAS order by id "
      
        Dim Adaptador As New OdbcDataAdapter(Sql, MyConexion)
        Try
            MyConexion.Open()
            Adaptador.Fill(CLINICAS)
        Catch ex As Exception
            MessageBox.Show("Error al cargar CLINICAS")
        Finally
            MyConexion.Close()
        End Try
        Return CLINICAS
Public Function CargaPacientes() As DataTable
        Dim PACIENTES As New DataTable
        Dim MyConexion As OdbcConnection = New OdbcConnection(StrCon)
        Dim Sql As String
      
            Sql = "Select id, nif, nombre, apellidos, apellidos + ', ' + nombre as MyNombre, via, direccion, Provincia, Localidad,  " _
          + " Postal, Telefono, Movil, Telefono2, Email, Nacimiento, Aseguradora, Antmedicos, Antdentales, Alergias, Relacion, " _
          + " Dudoso, Clinica, Tarifa, Bonificacion, Old " _
          + " FROM PACIENTES order by " + Order
       
        Dim Adaptador As New OdbcDataAdapter(Sql, MyConexion)
        Try
            MyConexion.Open()
            Adaptador.Fill(PACIENTES)
        Catch ex As Exception
            MessageBox.Show("Error al cargar grid de pacientes")
        Finally
            MyConexion.Close()
        End Try
        Return PACIENTES
    End Function



How I can get the value of the column postal when I select a row?

 thanks
Parents Reply Children
No Data