System.Data Namespace DataColumn Class
Returns the Expression of the column, if one exists.
[ VB ]
Overrides Public Function ToString ( ) As String
[ C# ]
public override string ToString ( );
[ C++ ]
public: String* ToString ( );
[ JScript ]
public override function ToString ( ) : String;
The Expression value, if the property is set; otherwise, the ColumnName property.
The following example uses the ToString property to return the default string of each member of a collection of DataColumn objects.
private void PrintColumns ( DataTable myTable ) {
// print the default string of each column in a collection.
foreach ( DataColumn myColumn in myTable.Columns ) {
Response.Write ( myColumn.ToString ( ) );
}
}
Private Sub PrintColumns ( myTable As DataTable )
' print the default string of each column in a collection.
Dim myColumn As DataColumn
For Each myColumn In myTable.Columns
Response.Write ( myColumn.ToString ( ) )
Next
End Sub |
|
C# |
VB |
DataColumn Members Expression ColumnName