
15/08/2007, 13:09
|
| | Fecha de Ingreso: agosto-2006 Ubicación: en lima peru
Mensajes: 184
Antigüedad: 18 años, 5 meses Puntos: 0 | |
Re: Combobox nose si te pueda servir esto
saludos
Imports System.Data.SqlClient, System.Data
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Using cn As New SqlConnection("initial catalog=northwind;integrated security=true;data source=.\SQLEXPRESS")
Using da As New SqlDataAdapter("select * from employees", cn)
Dim dt As New Data.DataTable
da.Fill(dt)
Dim FILA As DataRow = dt.NewRow
FILA("Employeeid") = DBNull.Value
FILA("LastName") = ""
dt.Rows.Add(FILA)
ComboBox1.DataSource = dt
ComboBox1.DisplayMember = "lastname"
ComboBox1.ValueMember = "Employeeid"
ComboBox1.Refresh()
End Using
End Using
End Sub
End Class |