Returns a SQL-DDL drop table statement for a table
Namespace:
Huagati.DBMLTools.RuntimeAssembly: HuagatiDBMLToolsRTE (in HuagatiDBMLToolsRTE.dll) Version: 1.66.3362.23798
Syntax
| C# |
|---|
public static string DropTableStatement( this MetaTable table ) |
| Visual Basic (Declaration) |
|---|
<ExtensionAttribute> _ Public Shared Function DropTableStatement ( _ table As MetaTable _ ) As String |
| Visual C++ |
|---|
[ExtensionAttribute] public: static String^ DropTableStatement( MetaTable^ table ) |
Parameters
- table
- Type: System.Data.Linq.Mapping..::.MetaTable
Linq-to-SQL MetaTable object for the table to generate the SQL-DDL 'drop table' statement for.
Return Value
A string containing SQL-DDL for dropping the table.
Examples
This example shows how to generate SQL-DDL drop table statements for each table in a database.
CopyC#
using Huagati.DBMLTools.Runtime; public class MappingSample { public void Test() { SomeDataContext dc = new SomeDataContext(); //iterate through the collection of tables defined in the datacontext foreach (System.Data.Linq.Mapping.MetaTable table in dc.Mapping.GetTables()) { string dropStatement = table.DropTableStatement(); } } }