1[SqlException (0x80131904): 拒绝了对对象 '****' (数据库 '***',架构 'dbo')的 EXECUTE 权限。]
“/”应用程序中的服务器错误。
SQL 拒绝了对对象 '***' (数据库 '****',架构 'dbo')的 EXECUTE 权限。
说明:执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息:System.Data.SqlClient.SqlException: 拒绝了对对象 '' (数据库 '',架构 'dbo')的 EXECUTE 权限。
源错误:
备注:如果有多个数据库链接,都要检查对应的数据库连接串。
2.X.PagedList 如何只获取一页的数据?使用类:StaticPagedList
(1)
public class UserController : Controller{public object Index(int? page){var pageIndex = (page ?? 1) - 1; //MembershipProvider expects a 0 for the first pagevar pageSize = 10;int totalUserCount; // will be set by call to GetAllUsers due to _out_ paramter :-|var users = Membership.GetAllUsers(pageIndex, pageSize, out totalUserCount);var usersAsIPagedList = new StaticPagedList<MembershipUser>(users, pageIndex + 1, pageSize, totalUserCount);ViewBag.OnePageOfUsers = usersAsIPagedList;return View();}}
(2)
@model X.PagedList.IPagedList<Model123>
@using System.Web.Optimization
@using X.PagedList.Mvc
@Html.PagedListPager(Model, page => Url.Action("Author", new { page }))
3.Templates can be used only with field access, property access, single-dimension array index, or sing
var tmpDate = item.PoesyDate.ToString("yyyy-MM-dd");@Html.DisplayFor(modelItem => tmpDate)|
4.Exeption handle:
(1)Application_Error:can't catch 404 error for static files such as html/jpg/JS
(2)if set up Application_Error,[ <customErrors mode="On" defaultRedirect="Error"/>] will not work
(3)HandleErrorAttribute will only control error
4.Get 404 code in MVC:(HttpException)ex).GetHttpCode()
如果觉得《VS ASP.NET MVC 5.0 开部署问题汇总》对你有帮助,请点赞、收藏,并留下你的观点哦!