Hi!
Here is My code i'm on entry level facing problem working on database in asp.net razor
@{
var db = Database.Open("SmallBakery");
var selectQueryString = "SELECT * FROM Product ORDER BY Name";
}
var db = Database.Open("SmallBakery");
var selectQueryString = "SELECT * FROM Product ORDER BY Name";
}
Small Bakery Products
| Id | Product | Description | Price |
|---|---|---|---|
| @row.Id | @row.Name | @row.Description | @row.Price |
When i run this code it's showing me an exception and that exception is (SqlException unhandle by user) please help me


Afzaal Ahmad ZeeshanRank #60 · 27.6K reputationPosted Dec 13, 2015, 9:51 PM EST
Raja TRank #685 · 3.5K reputationPosted Dec 13, 2015, 10:03 PM EST
Please check...
1. Verify the name of SQL server instance
2. Verify Whether the SQL server instance you are trying to connect is up & running
3. Verify the username is correct.
4. Verify the password is corerct.
Exception will be occuring when you are trying to open connection.
Afzaal Ahmad ZeeshanRank #60 · 27.6K reputationPosted Dec 13, 2015, 10:19 PM EST
Sadaqat Jeelani20 reputationPosted Dec 13, 2015, 11:30 PM EST