EF

1)简单查询

后台代码

 1 using MvcApplication18.Models;
 2 using System;
 3 using System.Collections.Generic;
 4 using System.Data.SqlClient;
 5 using System.Linq;
 6 using System.Web;
 7 using System.Web.Mvc;
 8 
 9 namespace MvcApplication18.Controllers
10 {
11     public class HomeController : Controller
12     {
13         //
14         // GET: /Home/
15         appDBEntities db = new appDBEntities();
16         public ActionResult Index()
17         {
18             SqlParameter[] parameter = { };
19             List<SecondHand_info> list = db.Database.SqlQuery<SecondHand_info>("select * from SecondHand_info where SecondHand_keyID >88", parameter).ToList();
20           ViewData["list"] = list;
21             return View();
22         }
23 
24     }
25 }
View Code

相关文章:

  • 2021-08-06
  • 2022-12-23
  • 2021-07-17
  • 2022-01-14
  • 2021-05-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-04
  • 2022-01-20
  • 2021-06-22
  • 2022-01-19
  • 2021-06-12
  • 2022-12-23
  • 2021-10-31
相关资源
相似解决方案