Here is my code:
protected void Button1_Click(object sender, EventArgs e)
{
string strFileType = System.IO.Path.GetExtension(FileUpload1.FileName).ToString
The column mappings are to be added to the bulkCopy.ColumnsMappings
collection:
var mapping1 = new SqlBulkCopyColumnMapping("id", "ida");
bulkCopy.ColumnMappings.Add(mapping1);
You do the mapping before you execute the WriteToServer
call.
The MSDN documentation of SqlBulkCopyColumnMapping
has further documentation and an example.