I have two listboxes, in the first listbox lstFields, I have the fields from the import table. In the second Listbox, lstMap, I have the columns of the excel spreadsheet being imported.
I select the field, select the column, press btnMap and I have the following code:
protected void btnMap_Click(object sender, EventArgs e)
{
lstOutcome.Items.Add(lstField.SelectedValue + " = " + lstMap.SelectedValue);
SqlBulkCopyColumnMapping mapping1 = new SqlBulkCopyColumnMapping(lstMap.SelectedValue, lstField.SelectedValue);
}
I also have a clear button that empties the listboxes: Heres the code for that:
protected void btnRemove_Click(object sender, EventArgs e)
  ...
Go to the complete details ...