Sub IsiCombo(ByVal obj As Object, ByVal ctable As String, ByVal cfield As String)
obj.Items.Clear()
SQL = "SELECT " & cfield & " FROM " & ctable
CMD = New SqlClient.SqlCommand(SQL, DB)
RD = CMD.ExecuteReader
Do While RD.Read
obj.Items.Add(Trim(RD(0)))
Loop
RD.Close()
End Sub
Pemanggilan pada tiap FORM
IsiCombo(KdBagian, "Bagian", "kdBagian")
0 comments:
Post a Comment
Terima kasih apabila sudah memberikan komentar yang baik dan sopan :)