I have this windows form with one ComboBox and one DataGridView. i am able to populate the Combobox , but i am having problem populating the GridView, once i select a value from the ComboBox. i put this piece of code on the Load event of the form which populate the ComboBox. Private Sub Receive_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadDim con As New SqlConnection(" Data Source=GX520B;Initial Catalog=ReturnEquipment;Integrated Security=True")Dim cmd As New SqlCommand("Select ItemSerialNumber FROM dbo.RmaDetails")cmd.Connection = con Dim da As New SqlDataAdapterDim ds As New DataSetda.SelectCommand = cmd ds.Clear() da.Fill(ds, "dbo.RmaDetails")If ds.Tables("dbo.RmaDetails").Rows.Count = 0 ThenMessageBox.Show( "There are currently no registries in the database.")ElseComboBox1.DataSource = ds.Tables( "dbo.RmaDetails") ComboBox1.DisplayMember = "ItemSerialNumber" End IfEnd Sub
If someone out there can help me with the grid view would be apreciated
|