UpdateDBSchema compares a data context meta model with a database and adjusts the db schema to match the data context model.
Namespace:
Huagati.DBMLTools.RuntimeAssembly: HuagatiDBMLToolsRTE (in HuagatiDBMLToolsRTE.dll) Version: 1.66.3362.23798
Syntax
C# |
---|
public static bool UpdateDBSchema( this DataContext dc, IDbConnection connection ) |
Visual Basic (Declaration) |
---|
<ExtensionAttribute> _ Public Shared Function UpdateDBSchema ( _ dc As DataContext, _ connection As IDbConnection _ ) As Boolean |
Visual C++ |
---|
[ExtensionAttribute] public: static bool UpdateDBSchema( DataContext^ dc, IDbConnection^ connection ) |
Parameters
- dc
- Type: System.Data.Linq..::.DataContext
A Linq to SQL data context.
- connection
- Type: System.Data..::.IDbConnection
A database connection for the database to update.
Return Value
True if successful, false if updating the schema failed.
Examples
This example shows how to call UpdateDBSchema for a specific connection.
CopyC#

using Huagati.DBMLTools.Runtime; public class UpdateDCSample { public void UpdateSchema() { SomeDataContext dc = new SomeDataContext(); //attempt to update the database schema dc.UpdateDBSchema(dc.Connection); } }