I have a table with many columns and I need to update the column that matches a set of parameters. Is it possible to concatenate a string and then use the string result to update a matching named column of a database using Telerik's OpenAccess? If so, I'm thinking reflection is required here? I would like to be able to do something like shown below:
A simplified example table:
Sku QtyOnHand Whse1Aug2017 Whse2Aug2017 Whse3Aug2017
==================================================================
ABC-123 87 2 4 8
XYZ-789 43 0 5 4
string warehouseId = "1"
string month = "Aug"
string year = "2017"
string sku = "ABC-123"
int qtySold = 3;
string columnName = "Whse" + warehouseId + month + year;
var query = (from s in model.Sales
where s.SKU == sku
select s).FirstOrDefault();
query.columnName = query.columnName + qtySold;
query.SaveChanges();