getting table columns/properties in 'table order'?

edited May 2012
Sometimes I want to view the rows of a table as they normally are *except* for one or two columns. In such a scenario, what I *really* want is some ability to have the final 'select row' magically expanded out to 'select new { row.Foo, row.Bar, ... }' (with newlines/indentation) but that seems unrealistic. However, I can get pretty close by using the backtick support, so I can hit it to add all the properties (although the list also includes methods, but I don't mind so much going back and removing them).

Unfortunately, the autocomplete list is in alphabetical order instead of 'table order' (the left-to-right order the columns show up in when doing just 'select row', which I'm assuming is the same order as the columns in the table definition in sql server).

Am I thinking of this the wrong way and/or is there an easier way to go about this?

My current workaround is to just export the results to excel and kill off the problematic columns (at least until I can refactor the schema to move them to another table :) but I'd love to be able to do it without having to leave LINQPad. :)



Sign In or Register to comment.