Click here to Skip to main content
15,901,505 members

Comments by Alexander Eirich (Top 3 by date)

Alexander Eirich 7-Oct-11 6:59am View    
//Initializing:
dTable = new DataTable();
dataAdapter.Fill(this.dTable);
dView = new DataView(dTable);
dataGridView1.DataSource = dView;

private void tsBCopy_Click(object sender, EventArgs e)
{
int copyCount = Convert.ToInt32(tbCopyCount.Text);
DataRowView[] newRows = new DataRowView[copyCount * dataGridView1.SelectedRows.Count];
for (int i = 0; i < dataGridView1.SelectedRows.Count; i++ )
{
newRows[i] = (DataRowView)dataGridView1.SelectedRows[i].DataBoundItem;
}
// And now I will change the primary Key in the newRows and Add it to the DataTable
}
Alexander Eirich 6-Oct-11 6:41am View    
the Function Copy() is not defined if i write this line.
Alexander Eirich 6-Oct-11 2:11am View    
Sorry, this not helps me...

i have a Class DataSet1 that includes a Class DataTable2, and I have a DataTable2TableAdapter.
With a dataTable2bindingSource the Table was bind to the DataGridView.

I should like copy one or more Rows in the DataGrid to dublicating DataRows, but i get with all ways a Exception...

Thanks for your help.