| |||||
DataColumnCollection.Add MethodSystem.Data Namespace DataColumnCollection Class Adds a DataColumn to the columns collection. Overload List1. Initializes and adds a new DataColumn to the columns collection. 2. Initializes and adds a specified DataColumn object to the columns collection. 3. Initializes and adds a DataColumn with the specified name to the columns collection. 4. Initializes and adds a DataColumn with the specified name and type to the columns collection. 5. Initializes and adds a DataColumn with the specified name, type, and expression to the columns collection. ExampleThe following example initializes and adds a new DataColumn to a DataColumnCollection of a DataTable.
Private Sub AddColumn ( )
Dim cols As DataColumnCollection
Dim myCol As DataColumn
' get the DataColumnCollection of a table in a DataSet.
cols=ds.Tables ( "Orders" ).Columns
' add a new column and return it.
myCol=cols.Add ( "Total", System.Type.GetType ( "System.Decimal" ), _
"Price + Tax" )
myCol.ReadOnly=True
myCol.Unique=False
End Sub
See Also |
| ||||
Check out related books at Amazon
© 2000-2008 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 aspxtreme