我有下面的代码从我的数据库中的表中返回数据。
我已经尝试过使用存储过程但没有成功,所以任何人都可以建议我如何在两个日期之间使用以使以下代码工作。
谢谢
Imports System.Data.Entity
Public Class HomeController
Inherits System.Web.Mvc.Controller
Private db As New ArticlesDBContextNew
Function Index() As ActionResult
ViewData("Message") = "Modify this template to jump-start your ASP.NET MVC application."
Dim Articles = From Title In db.ArticlesList Select Title
Articles = Articles.Where(Function(s) s.PublishdateFrom > (Date.Now.Date) And s.PublishDateTo > (Date.Now.Date))
Return View(db.ArticlesList.ToList())
Return View(Articles)
Return View()
End Function
Function About() As ActionResult
ViewData("Message") = "Your app description page."
Return View()
End Function
Function Contact() As ActionResult
ViewData("Message") = "Your contact page."
Return View()
End Function
End Class