Razor – Database Programming Exercise

In this chapter you will get some practice questions which help you to understand the concept of database connectivity in razor markup more clearly.
Qu 1: Create a database "mobile" for mobile shop. This database contains table "brand" which holds the following column.

ID – It should be primary key, auto increment and int type.
MobileName – Keep it nvarchar 50
Price – keep it nvarchar 50

Add 10 entries using Insert command and then display data using simple HTML table and WebGrid.


This practice question will enhance your Razor knowledge. In the next chapter you will learn to work with Form in Razor.

Share your thought