在我使用 .Net Framework 的旧项目中,使用
using System.Data.SqlClient;
Run Code Online (Sandbox Code Playgroud)
和
if (ex.GetType() == typeof(SqlException))
{
return ErrorMessage((SqlException)ex);
}
Run Code Online (Sandbox Code Playgroud)
现在在.NET CORE中不知道上面的代码
如何typeof(SqlException)在.NET CORE中使用?
这是我的EF Core代码:
int page = 1, rowPerPage = 5;
int count = ctx.Specialty.Count();
int start = page * rowPerPage;
var Select = ctx.Specialty.OrderByDescending(u => u.IdS)
.Skip(start)
.Take(rowPerPage)
.AsEnumerable();
Run Code Online (Sandbox Code Playgroud)
我正在使用SQL Server 2008和Visual Studio 2017,也安装了SQL Server 2017。我的项目是ASP.NET Core。
错误:
“ OFFSET”附近的语法不正确。FETCH语句中选项NEXT的无效用法
我认为问题是SQL Server 2008。
如何告诉我的项目使用SQL Server 2017?
c# asp.net sql-server-2008 entity-framework-core asp.net-core