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.

Summary

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

More Articles

 

Share your thought



PLEASE DISABLE ADBLOCKER AND SUPPORT US!

Please support us by enabling ads on this page. Refresh

YOU DON'T LIKE ADS, WE ALSO DON'T LIKE ADS!
 
But we have to show ads on our site to keep it free and updated. We have to pay huge server costs, domain costs, CDN Costs, Developer Costs, Electricity and Internet Bill. Your little contribution will encourage us to regularly update this site.