This is a simple application that show how to create model class to Link to Sql in MVC ASP.NET. In this application we first create the database after that create the schema and insert the data.
Introduction: This is a simple application that show how to create model class to Link to Sql in MVC ASP.NET. In this application we first create the database after that create the schema and insert the data. After that we add the one Linq to SQL class in the model folder and drag and drop a table schema. We know that MVC is the separated word that is models,views,controllers. In model folder we have create the business logic.views is provide GUI and last controller handle the all request provide by models and views.ASP.NET MVC provide some tools that used add the data base in your application easily. This is a very simple program I hope it's very helpful for beginners and solve the problem how to create database in a MVC application.
Step 1: Open Visual Studio 2010.
Step 2: Next step add one folder in Solution Explorer.
Step 3: In a App_Data folder, add Sqldatabase.
Step 4: After adding the SQL database, two files are created in the folder.
Step5: Open the Server Explorer.
Step6: Set the primary key
Step7: Open table
Step 8:Add Linq to SQL class.
ASP.NET GridView Control Pocket Guide