asp.net.ph

DataColumn.ToString Method

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;

Return Value

The Expression value, if the property is set; otherwise, the ColumnName property.

Example

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 ( ) );
   }
}
  C# VB

See Also

DataColumn Members   Expression   ColumnName Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph