MVC CSHTML Database connection using Connectionstring
got error WebMatrix.Data
you have to do reference in reference folder
find WebMatrix.Data.dll in machine browse and add. after that write code as following:-
@using WebMatrix.Data;
@{
/**/
ViewBag.Title = "About";
var db = Database.Open("vislidbConnectionString");
var selectQueryString = "SELECT * FROM [vislidb].[dbo].[tbl_OrderUserDetails]";
}
Use this area to provide additional information.
this is test1
this is test2
Id
Product
Description
Price
got error WebMatrix.Data
you have to do reference in reference folder
find WebMatrix.Data.dll in machine browse and add. after that write code as following:-
@using WebMatrix.Data;
@{
/**/
ViewBag.Title = "About";
var db = Database.Open("vislidbConnectionString");
var selectQueryString = "SELECT * FROM [vislidb].[dbo].[tbl_OrderUserDetails]";
}
@ViewBag.Title.
@ViewBag.Message
Use this area to provide additional information.
this is test1
this is test2
@foreach (var row in db.Query(selectQueryString))
{
}