This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Once you have bound your database table to a model, the model class is called an Entity and the Entity gives you access to the Table and to the different records in the table: WebAccounts => Dabase name WebAccountsEntities => Model Class name for WebAccounts Accounts => Table object in the WebAccountsEntities class Account => Class name of Record in Accounts table To access table data in a Controller function you do the following: Byval db As New WebAccountsEntities Creates a new Model for the Database ByVal accountrecord As New Account Creates a new Account record accountrecord.Fullname = "John Smith" Fills in a field in the Account record db.AddToAccounts(accountrecord) Adds the Account record to the Accounts table Return View(db.Accounts) Returns the table data in the Model to a view 1 of 1...
View Full Document
- Spring '12