Good evening, people,
I have a problem in a project in C # where I need to navigate a bindingSource and go filling the fields of the form with the values referring to the position of the bindingSource, I already have it filled everything okay problem ta when I go to the next register it from the error in the textBox saying that already has an association follows the message "this generates two associations in the collection to connect to the same property", below the code
private void btnProximo_Click(object sender, EventArgs e)
{
if (bindingSourcePais.Position + 1 < bindingSourcePais.Count)
{
try
{
proximo();
}
catch (Exception ex)
{
Util_Msg.erro(ex.Message);
}
}
}
private void proximo()
{
bindingSourcePais.MoveNext();
txtCodigo.DataBindings.Add("Text", bindingSourcePais, "codigo");
txtNome.DataBindings.Add("Text", bindingSourcePais, "nome");
}