Information générale
Titre:
Getting field value from DataRowView
I'm trying to use C# to retrieve a value from a field in a Datagrid.
The DataGrid is bound to a DataSet object and it is populated with data.
I am trying to use the DataRowView to get the current value of a field in the current row.
Here is my DataRowView line:
DataRowView oDataRow = (DataRowView) this.BindingContext[myDataSet, "mytable"].Current;
Now how can I get the value of a field called COMPANY from the DataRowView object?
I tried this, but only the field name is returned not the value.
string companyname = oDataRow.DataView.Table.Columns["company"].ToString();
Any other suggestion on retrieve a field from the current row in a DataSet would be great.
Thanks,
Jerryt
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement