Get columns names

I am trying to do a SqlBulkCopy from csv file to db. Since the columns are more than 50, I need to get columns names from DataContext's table. How to do this? Or is there a better way to do bulk copy?

Comments

  • I got it.

    foreach( var p in new MyTableName().GetType().GetProperties())
    p.Name.Dump();
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!