TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sadaqat Jeelani
NA
20
15k
Database Connection in Asp.net using Razor
Dec 14 2015 2:31 AM
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";
}
<html>
<body>
<h1>Small Bakery Products</h1>
<table>
<tr>
<th>Id</th>
<th>Product</th>
<th>Description</th>
<th>Price</th>
</tr>
@foreach(var row in db.Query(selectQueryString))
{
<tr>
<td>
@row.Id
</td>
<td>
@row.Name
</td>
<td>
@row.Description
</td>
<td align="right">
@row.Price
</td>
</tr>
}
</table>
</body>
</html>
When i run this code it's showing me an exception and that exception is (SqlException unhandle by user) please help me
Reply
Answers (
4
)
Embed Google map in ASP.Net without iframe
Encrypt a url in mvc 4