'Colocar este codigo en el evento CLIC del combobox
Try
'''''''''''''''''''''''''''''''''''''''''''''''''
CLAVE.CONEXION.Open()
SQL = "SELECT COLUMN_NAME FROM information_schema.columns WHERE
table_name = 'NOMBRE DE LA TABLA'"
'''''''''''''''''''''''''''''''''''''''''''''''''
ORDEN_BD = New OleDb.OleDbCommand(SQL, CONEXION)
ORDEN_BD.CommandType = CommandType.Text
ORDEN_BD.ExecuteNonQuery()
REM Cierro la
CONEXION
D_ADAPTER = New OleDbDataAdapter(ORDEN_BD)
D_TABLE = New DataTable
D_ADAPTER.Fill(FormClave.D_TABLE)
COMBOBOX1.DataSource
= D_TABLE
COMBOBOX1.DisplayMember = "COLUMN_NAME"
COMBOBOX1.ValueMember = "COLUMN_NAME"
'''''''''''''''''''''''''''''''''''''''''''''''''
CLAVE.CONEXION.Close()
Catch ex As Exception
'MessageBox.Show(ex.Message)
'''''''''''''''''''''''''''''''''''''''''''''''''
CLAVE.CONEXION.Close()
End Try
No hay comentarios:
Publicar un comentario