In C# code, I would like to bind a column in a typed data set row to
an edit box (or other control) without having to use a string literal
for the column name.
For example, the following works:
TypedDataSet.TableRow row;
editBox.DataBindings.Add("EditValue", row, "col_name");
However, the above is not type safe and I cannot use autocompletion so
have to muck around to get the column name. For example, if col_name
is mistyped, or the typed data set no longer has this column then the
code will still compile.
What I would prefer to say would be something like:
editBox.DataBindings.Add("EditValue", row, row.col_name.GetName() );
Where GetName would return the string "col_name"