Public Sub getFamilyRel(cb As ComboBox) Try Dim CMD As New SqlClient.SqlCommand Dim dt As New DataTable CMD.CommandText = "select Code, code + ' - ' + description as Des from famrelup" CMD.CommandType = CommandType.Text Dim CN As New SqlClient.SqlConnection(My.Settings.cdataConnectionString.ToUpper) CMD.Connection = CN CN.Open() Dim RDR As New SqlClient.SqlDataAdapter RDR.SelectCommand = CMD RDR.Fill(dt) With cb .DataSource = dt .ValueMember = "code" .DisplayMember = "des" End With Catch ex As Exception MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)