Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linq to SQL create table

I need to write an WPF(4.0) application which has a DB but no tables in it. The app has to create some tables in the DB and then start working with them. I am wondering , is there a way to do it in Linq to SQL ?

like image 922
N.D Avatar asked Apr 09 '12 05:04

N.D


1 Answers

You can do this programatically. i.e. You can create programatically your tables, according to given parameters, also it is possible to build the relations between tables... :)

As there is no direct function create table, you can use the ExecuteCommand -method of the DataContext to run some T-SQL statements for creating tables.

like image 96
mihai Avatar answered Oct 11 '22 10:10

mihai