Adds a column to an existing SQL server table and assigns a default value
Namespace:
DbNetLink.DataAssembly: DbNetLink.DbNetData (in DbNetLink.DbNetData.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
| C# |
|---|
public void AddColumn( string TableName, string ColumnName, string ColumnDef, Object DefaultValue ) |
| Visual Basic (Declaration) |
|---|
Public Sub AddColumn ( _ TableName As String, _ ColumnName As String, _ ColumnDef As String, _ DefaultValue As Object _ ) |
| Visual C++ |
|---|
public: void AddColumn( String^ TableName, String^ ColumnName, String^ ColumnDef, Object^ DefaultValue ) |
Parameters
- TableName
- Type: System..::.String
The name of the table
- ColumnName
- Type: System..::.String
The name of the column
- ColumnDef
- Type: System..::.String
The column definition
- DefaultValue
- Type: System..::.Object
The default value for the columns
Examples
DbNetData Db = new DbNetData( "DbNetTime" ); Db.Open(); Db.AddColumn("dbnettime_config", "singlestep_quickentry", "bit", 1); Db.AddColumn("dbnettime_user", "supplies_start_end", "bit", 0); Db.Close();