list导入失败提示第0行Cannot access destination table 'group'.

发布于 2020-08-18 22:43:14

捕获.PNG

· model

namespace imtim.Model
{
    [Table("group")]
    public class Group : BasePoco
    {
        [Display(Name = "班组名称")]
        [Required(ErrorMessage = "班组名称是必填项")]
        public string Name { get; set; }
        public Workship Workship { get; set; }
        [Display(Name = "所属部门")]
        [Required(ErrorMessage = "所属部门是必填项")]
        public Guid? WorkshipId { get; set; }
    }
}

namespace imtim.Model
{
    [Table("workship")]
    public class Workship : BasePoco
    {
        [Display(Name = "部门(车间)名称")]
        [Required(ErrorMessage = "部门(车间)名称是必填项")]
        public string Name { get; set; }
        [Display(Name = "父级")]
        public Workship Parent { get; set; }
        [Display(Name = "父级")]
        public Guid? ParentId { get; set; }
    }
}

· vs输出
Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/2.0 POST https://localhost:44316/sources/Group/Import?1=1&_=1597760394212 application/x-www-form-urlencoded; charset=UTF-8 49
Microsoft.AspNetCore.Cors.Infrastructure.CorsService: Information: CORS policy execution failed.
Microsoft.AspNetCore.Cors.Infrastructure.CorsService: Information: Request origin https://localhost:44316 does not have permission to access the resource.
Microsoft.AspNetCore.Cors.Infrastructure.CorsService: Information: CORS policy execution failed.
Microsoft.AspNetCore.Cors.Infrastructure.CorsService: Information: Request origin https://localhost:44316 does not have permission to access the resource.
Microsoft.AspNetCore.Routing.EndpointMiddleware: Information: Executing endpoint 'imtim.Controllers.GroupController.Import (imtim)'
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker: Information: Route matched with {area = "sources", action = "Import", controller = "Group"}. Executing controller action with signature Microsoft.AspNetCore.Mvc.ActionResult Import(imtim.ViewModel.sources.GroupVMs.GroupImportVM, Microsoft.AspNetCore.Http.IFormCollection) on controller imtim.Controllers.GroupController (imtim).
Microsoft.EntityFrameworkCore.Infrastructure: Information: Entity Framework Core 3.1.5 initialized 'DataContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: SensitiveDataLoggingEnabled DetailedErrorsEnabled
Microsoft.EntityFrameworkCore.Database.Command: Information: Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT [w].[ID], [w].[CreateBy], [w].[CreateTime], [w].[Name], [w].[ParentId], [w].[UpdateBy], [w].[UpdateTime]
FROM [workship] AS [w]
Microsoft.EntityFrameworkCore.Database.Command: Information: Executed DbCommand (0ms) [Parameters=[@__UploadFileId_0='5dc2609e-0018-4a21-a304-40f1d7d015a4' (Nullable = true)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [f].[ID], [f].[CreateBy], [f].[CreateTime], [f].[FileData], [f].[FileExt], [f].[FileName], [f].[GroupName], [f].[IsTemprory], [f].[Length], [f].[Path], [f].[SaveFileMode], [f].[UpdateBy], [f].[UpdateTime], [f].[UploadTime]
FROM [FileAttachments] AS [f]
WHERE [f].[ID] = @__UploadFileId_0
Microsoft.AspNetCore.Mvc.ViewFeatures.PartialViewResultExecutor: Information: Executing PartialViewResult, running view Import.
Microsoft.AspNetCore.Mvc.ViewFeatures.PartialViewResultExecutor: Information: Executed PartialViewResult - view (null) executed in 4.1589ms.
WalkingTec.Mvvm.Core.ActionLog: Information:
|-操作时间:2020/8/18 22:25:24
|-账号:admin
|-IP:::1
|-模块:工区管理
|-方法:导入
|-Url:/sources/Group/Import
|-时长:0.02 s
|-备注:

Microsoft.EntityFrameworkCore.Infrastructure: Information: Entity Framework Core 3.1.5 initialized 'DataContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: SensitiveDataLoggingEnabled DetailedErrorsEnabled
Microsoft.EntityFrameworkCore.Database.Command: Information: Executed DbCommand (0ms) [Parameters=[@p0='6e3518cd-203e-48c6-898e-1d27dde0719f', @p1='导入' (Size = 50), @p2='2020-08-18T22:25:24', @p3='/sources/Group/Import' (Size = 250), @p4=NULL (Size = 50), @p5=NULL (DbType = DateTime2), @p6='0.0229021', @p7='::1' (Size = 50), @p8='admin' (Size = 50), @p9='0', @p10='工区管理' (Size = 50), @p11='' (Size = 4000), @p12=NULL (Size = 50), @p13=NULL (DbType = DateTime2)], CommandType='Text', CommandTimeout='30']
SET NOCOUNT ON;
INSERT INTO [ActionLogs] ([ID], [ActionName], [ActionTime], [ActionUrl], [CreateBy], [CreateTime], [Duration], [IP], [ITCode], [LogType], [ModuleName], [Remark], [UpdateBy], [UpdateTime])
VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13);
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker: Information: Executed action imtim.Controllers.GroupController.Import (imtim) in 41.611ms
Microsoft.AspNetCore.Routing.EndpointMiddleware: Information: Executed endpoint 'imtim.Controllers.GroupController.Import (imtim)'
Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request finished in 58.8874ms 200 text/html; charset=utf-8
Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/2.0 GET https://localhost:44316/_Framework/GetFileName/5dc2609e-0018-4a21-a304-40f1d7d015a4?_DONOT_USE_CS=default&_=1597760394215
Microsoft.AspNetCore.Routing.EndpointMiddleware: Information: Executing endpoint 'WalkingTec.Mvvm.Mvc._FrameworkController.GetFileName (WalkingTec.Mvvm.Mvc)'
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker: Information: Route matched with {action = "GetFileName", controller = "_Framework", area = ""}. Executing controller action with signature Microsoft.AspNetCore.Mvc.IActionResult GetFileName(System.Guid, System.String) on controller WalkingTec.Mvvm.Mvc._FrameworkController (WalkingTec.Mvvm.Mvc).
Microsoft.EntityFrameworkCore.Infrastructure: Information: Entity Framework Core 3.1.5 initialized 'DataContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: SensitiveDataLoggingEnabled DetailedErrorsEnabled
Microsoft.EntityFrameworkCore.Database.Command: Information: Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT TOP(2) [f].[ID], [f].[CreateBy], [f].[CreateTime], [f].[FileData], [f].[FileExt], [f].[FileName], [f].[GroupName], [f].[IsTemprory], [f].[Length], [f].[Path], [f].[SaveFileMode], [f].[UpdateBy], [f].[UpdateTime], [f].[UploadTime]
FROM [FileAttachments] AS [f]
WHERE [f].[ID] = '5dc2609e-0018-4a21-a304-40f1d7d015a4'
Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor: Information: Executing ObjectResult, writing value of type 'System.String'.
WalkingTec.Mvvm.Core.ActionLog: Information:
|-操作时间:2020/8/18 22:25:24
|-账号:admin
|-IP:::1
|-模块:框架
|-方法:获取文件名
|-Url:/_Framework/GetFileName/5dc2609e-0018-4a21-a304-40f1d7d015a4
|-时长:0.01 s
|-备注:

Microsoft.EntityFrameworkCore.Infrastructure: Information: Entity Framework Core 3.1.5 initialized 'DataContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: SensitiveDataLoggingEnabled DetailedErrorsEnabled
Microsoft.EntityFrameworkCore.Database.Command: Information: Executed DbCommand (0ms) [Parameters=[@p0='1d12df20-af82-478a-8a31-b43c7f78d29e', @p1='获取文件名' (Size = 50), @p2='2020-08-18T22:25:24', @p3='/_Framework/GetFileName/5dc2609e-0018-4a21-a304-40f1d7d015a4' (Size = 250), @p4=NULL (Size = 50), @p5=NULL (DbType = DateTime2), @p6='0.0062895', @p7='::1' (Size = 50), @p8='admin' (Size = 50), @p9='0', @p10='框架' (Size = 50), @p11='' (Size = 4000), @p12=NULL (Size = 50), @p13=NULL (DbType = DateTime2)], CommandType='Text', CommandTimeout='30']
SET NOCOUNT ON;
INSERT INTO [ActionLogs] ([ID], [ActionName], [ActionTime], [ActionUrl], [CreateBy], [CreateTime], [Duration], [IP], [ITCode], [LogType], [ModuleName], [Remark], [UpdateBy], [UpdateTime])
VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13);
Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker: Information: Executed action WalkingTec.Mvvm.Mvc._FrameworkController.GetFileName (WalkingTec.Mvvm.Mvc) in 13.6733ms
Microsoft.AspNetCore.Routing.EndpointMiddleware: Information: Executed endpoint 'WalkingTec.Mvvm.Mvc._FrameworkController.GetFileName (WalkingTec.Mvvm.Mvc)'
Microsoft.AspNetCore.ResponseCaching.ResponseCachingMiddleware: Information: The response could not be cached for this request.
Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request finished in 24.7124ms 200 text/plain; charset=utf-8
线程 0x42e4 已退出,返回值为 0 (0x0)。
线程 0x4e2c 已退出,返回值为 0 (0x0)。
线程 0x5508 已退出,返回值为 0 (0x0)。
线程 0x3884 已退出,返回值为 0 (0x0)。
线程 0x63fc 已退出,返回值为 0 (0x0)。
线程 0xd18 已退出,返回值为 0 (0x0)。
线程 0x5934 已退出,返回值为 0 (0x0)。
线程 0x2658 已退出,返回值为 0 (0x0)。
线程 0x1e94 已退出,返回值为 0 (0x0)。
线程 0x3af0 已退出,返回值为 0 (0x0)。
线程 0x5df8 已退出,返回值为 0 (0x0)。
线程 0x611c 已退出,返回值为 0 (0x0)。

查看更多

关注者
1
被浏览
202
刘亮
刘亮 2020-08-19
专业编码30年

这是提示你数据库没有group这个表啊

1 个回答

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览