Tuesday, April 2, 2013

Create Database from the .dbml file in .Net

If you have .dbml file, you just have to write two lines which are as follows:

YourDBMLDataContext objContext = new YourDBMLDataContext();
objContext.CreateDatabase();

Note: Make sure, you have given the right ConnectionString to the .dbml file.

By running the above code, New database will be created in the database server.

2 comments: