Hello,
here's my situation :
I've got a usercontrol, that contains fields generated from dataset by Visual Studio 2005.
I've another dataset that is bind to a DataGrid, always generated using VS2005 drag and drop.
I need to filter the rows of this 2° dataset on IdRubrica, that's the primary key of the user control's bind.
What's the best way to do that? have I to set a foreign key on Table1.IdRubrica -> Table2.IdRubrica??? for loading data, Ive done this way:
private void agendaRubricaBindingSource_CurrentItemChanged(object sender, EventArgs e)
{
DataRowView myRow = (DataRowView)(this.agendaRubricaBindingSource.Current);
int idRubrica = Convert.ToInt32(myRow.Row["IdRubrica"]);
this.agendaTelefoniTableAdapter.Fill(this.agendaTelefoniTDS.AgendaTelefoni, idRubrica);
agendaTelefoniDataGridView.Refresh();
}
I need also to set the values of IdRubrica for INSERT query, how I do that into the binding source?
thanks a lot
Paolo