Returns a SQL-DDL create table statement for a table.
Namespace:
Huagati.DBMLTools.RuntimeAssembly: HuagatiDBMLToolsRTE (in HuagatiDBMLToolsRTE.dll) Version: 1.66.3362.23798
Syntax
| C# |
|---|
public static string CreateTableStatement( this MetaTable table ) |
| Visual Basic (Declaration) |
|---|
<ExtensionAttribute> _ Public Shared Function CreateTableStatement ( _ table As MetaTable _ ) As String |
| Visual C++ |
|---|
[ExtensionAttribute] public: static String^ CreateTableStatement( MetaTable^ table ) |
Parameters
- table
- Type: System.Data.Linq.Mapping..::.MetaTable
Linq-to-SQL MetaTable object for the table to generate the SQL-DDL 'create table' statement for.
Return Value
A string containing a SQL-DDL 'create table' statement.
Examples
This example shows how to generate a SQL-DDL create table statement 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 createTable = table.CreateTableStatement(); } } }