SetCurrentRowColumnByName()
- Last UpdatedNov 25, 2015
- 1 minute read
Use the SetCurrentRowColumnByName() method to update the column named ColumnName in the currently selected row.
Syntax
result SetCurrentRowColumnByName (
string ColumnName,
object NewValue)
Parameters
ColumnName
String constant that is enclosed in quotation marks or another ArchestrA reference that can evaluate to a string. For example:
"LastName" – Spaces are allowed.
For more details see SQL Server documentation regarding column naming rules.
NewValue
You can specify a constant or a valid ArchestrA reference string. Both relative references and fully qualified references are supported. For example:
-
me.ShortDesc – relative reference
-
UD1.status – fully qualified reference string
-
"John Smith" – constant
Remarks
Necessary conversions are performed internally to cast newValue to the column type.
When you try to change a value using this method and the type passed in does not match the type specified for the column in the database table, one of the following outcomes occurs:
-
The value is written with an automated type conversion
-
The transaction fails completely because the conversion would result in loss of data.
The actual update to the data source is delayed until you call SaveChangesSync() or SaveChangesAsync().