How to link the table of the database to your application in Asp.Net MVC ?

Posted by Goud.Kv under ASP.NET MVC category on | Points: 40 | Views : 1000
The Code below shows how to make contact with the table of a database.

Just add a table attribute to your Model class as below,

public class myModel {

public string Name { get; set; }
public string EmbedCode { get; set; }
public string Description { get; set; }


The attribute '[Table("MyTableDb")] allows your application to communicate with the table(MyTableDb) in the database.

Comments or Responses

Login to post response