I have a very simple scenario:
I have a table having structure:
TableTest:
- col1
- col2
- col3
- col4
now I have a UI, where user gets to choose out of these columns (columnNames in ListBox or checkboxList for Column Names) and a button.
Now, if user selects first two columns, then, result set should contain rows with only these two Columns. If user selects first three columns, then result set should contains rows with only these three columns.
i.e. I want something similar to below scenario
MetaTable userMeta = db.Mapping.GetTable(typeof(ThreatMaster));
var columnNames = userMeta.RowType.PersistentDataMembers;
IList<string> selectedColumns = columnNames.Where(c=>!c.IsAssociation)
.Select(c=>c.Name).ToList();
objDataContext.TableTests.Select(selectedColumns);
also. I have done objDataContext.TableTests
, what If i want to provide columns from different table??
:D:D..am not that efficient in Linq.
please see if my question makes any sense or is valid or i just missed something, some basics and went in the wrong direction
How can I do so? I went through this and this question overhere...