Y me sale error diciendome: 'La tabla no tiene clave principal'; la bd esta en access y si, si tiene por supuesto que tiene la clave la principal; que es el campo codigo o id, no se porque dice eso que no tiene clave principal, cuando en realidad si la tieneee
Código:
  
 Private Sub cboMaterial_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboMaterial.SelectedIndexChanged
        Dim Ds As New DataSet
        Dim Iva As Decimal
        Dim Prec As Decimal
        Dim Codigo As Integer = cboMaterial.SelectedValue
        Dim DA As New OleDb.OleDbDataAdapter
        Dim cmd As New OleDb.OleDbCommand
        cmd.Connection = Cnn
        cmd.CommandText = "Articulos"
        cmd.CommandType = CommandType.TableDirect
        DA.SelectCommand = cmd
        DA.Fill(Ds, "Articulos")
        Dim FilaArt As DataRow = Ds.Tables("Articulos").Rows.Find(Codigo)
       
 If Not (FilaArt Is Nothing) Then
            Prec = FilaArt.Item("PrecioUnitario")
            Iva = FilaArt.Item("PorcentajeIva")
           
            lblPrecio.Text = Prec
            lblIVA.Text = Format(Iva, "00.00")
        End If
    End Sub
 

