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

Sadaqat JeelaniPosted Dec 14, 2015, 4:30 AM
Afzaal Ahmad ZeeshanPosted Dec 14, 2015, 3:19 AM
Raja TPosted Dec 14, 2015, 3:03 AM
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 ZeeshanPosted Dec 14, 2015, 2:51 AM