Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

How will trim excel coumn with special chars (_;#' ') Bulkcopy column mapping add to load in SQL server DB table

$
0
0

Hi,

BC.ColumnMappings.Add("DATExx_xxx", "DATExx_xxx");
                               BC.ColumnMappings.Add("vxxxx_DATE", "vxxx_DATE");
                               BC.ColumnMappings.Add("Gxx_TO_xxxD", "Gxx_TO_xxxD");


Excel columns

---------------             ---------------            ---------------    -----..,,etc,,       

DATExx_xxx    vxxx_DATE     Gxx_TO_xxxD                     ........,,,etc,,

---------------            ---------------             ---------------    ----...,etc,,  

it may varies some time like    DATExx#xxx ,  vxxx#DATE ,Gxx#TO#xxxD like for all excel columns

So how can trim  with special chars (_;#' ') in above code

foreach (var column in dt.Columns)

                               { BC.ColumnMappings.Add(column.ToString(), column.ToString()); }
in above part how will do  .to string upper/trim with special chars  for all excel columns to dump in SQL Db table ???

Thanks







Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>