Conversion of the "DBML" file to the "SQL Database File"

I have a DBML database file and you want to create an SQL database file from this file.

thank

+3
source share
2 answers

There is a method in the data context called CreateDatabase () that you could use.

http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.createdatabase.aspx

+2
source

I do not know the available utilities that do this, and it's a little important to do for the SO answer.

, , . DBML XML; Linq-to-xml. SQL xml script. script. ( XSLT)

<Table Name="dbo.Person" Member="Persons"> 

 CREATE TABLE Persons (

  <Column Name="PersonID" Type="System.Int32" DbType="Int NOT NULL IDENTITY"
          IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false">
  </Column>

  <Column Name="AddressID" Type="System.Int32" DbType="Int NOT NULL" 
          CanBeNull="false"></Column>  

:

 PersonID Int NOT NULL,
 AddressID int NOT NULL,

..

+1

Source: https://habr.com/ru/post/1762875/


All Articles