asp.net.ph

DataColumn.AllowDBNull Property

System.Data Namespace   DataColumn Class


Sets or retrieves a value indicating whether null values are allowed in this column for rows belonging to the table.

Syntax


Script DataColumn.AllowDBNull [ = true | false ]

Property Value

This property accepts or returns only a boolean value: true if null values values are allowed; otherwise, false. The default is true.

Example

The following example initializes a new DataColumn and sets its AllowDBNull property to true.

private void AddNullAllowedColumn ( ) {
   DataColumn myColumn = new DataColumn ( "classID", 
      System.Type.GetType ( "System.Int32" ) );
   myColumn.AllowDBNull = true;

   // add the column to a new DataTable.
   DataTable myTable = new DataTable ( );
   myTable.Columns.Add ( myColumn );
}
  C# VB

See Also

DataColumn Members   Unique 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