简体   繁体   English

Visual Studio 2012内部出错 - “'。' 或'('预期'

[英]Error Inside Of Visual Studio 2012 - “ '.' or '(' expected ”

SELECT TOP 1000 [GUID]
      ,[Ticket_Number]
      ,[Created_At]
      ,[Changed_At]
      ,[Priority]
      ,[Department]
      ,[Ticket_Type]
      ,[Category]
      ,[SubCategory]
      ,[Second_Category]
      ,[Third_Category]
      ,[ZZARN]
      ,[Categorization_Hash_Key]
      ,[ZZAID]
      ,[Work_Order]
      ,[Contact_Type]
      ,[Action]
      ,[BPartner_Key]
      ,[PFT]
      ,[Ticket_Status_Code]
      ,[Ticket_Status]
      ,[Audit_Key]
  FROM [CorporateDWTest].[dbo].[SRS_Ticket_Transaction_Stage_Cleaned]

& Design: http://i40.tinypic.com/2ufvshz.png &Design: http//i40.tinypic.com/2ufvshz.png

Ya i deleted everything else, if someone has any idea what the guy who posted an answer refers to in reference to my tables column name design and structure please feel free to answer. 我删除了其他一切,如果有人知道发布答案的人是指​​参考我的表列名称设计和结构,请随时回答。

Class definition (That is inside of the Model1.Context.CS(.edmx)): 类定义(在Model1.Context.CS(.edmx)中):

public DbSet<SRS_Ticket_Transaction_Stage_Cleaned> SRS_Ticket_Transaction_Stage_Cleaned { get; set; }

namespace CorporateDWTesting
{
    using System;
    using System.Collections.Generic;

    public partial class CRM_Ticket_Transaction_Stage_Cleaned
    {
        public byte[] GUID { get; set; }
        public string Ticket_Number { get; set; }
        public decimal Created_At_UTC { get; set; }
        public decimal Changed_At_UTC { get; set; }
        public string Priority { get; set; }
        public string Department { get; set; }
        public string Municipality { get; set; }
        public string Ticket_Type { get; set; }
        public string Category { get; set; }
        public string SubCategory { get; set; }
        public string Address_Number { get; set; }
        public string Street1 { get; set; }
        public string Street2 { get; set; }
        public string Contact_Type { get; set; }
        public string Action { get; set; }
        public string BPartner_Key { get; set; }
        public Nullable<int> PFT { get; set; }
        public string Ticket_Status_Code { get; set; }
        public string Ticket_Status { get; set; }
        public Nullable<decimal> Due_Date_UTC { get; set; }
        public int Audit_Key { get; set; }

        public virtual Dim_Audit Dim_Audit { get; set; }
    }
}

Dim_Audit: Dim_Audit:

namespace CorporateDWTesting
{
    using System;
    using System.Collections.Generic;

    public partial class Dim_Audit
    {
        public Dim_Audit()
        {
            this.Business_Partner_Stage = new HashSet<Business_Partner_Stage>();
            this.CRM_Ticket_Transaction_Stage = new HashSet<CRM_Ticket_Transaction_Stage>();
            this.CRM_Ticket_Transaction_Stage_Cleaned = new HashSet<CRM_Ticket_Transaction_Stage_Cleaned>();
            this.Dim_Audit1 = new HashSet<Dim_Audit>();
            this.Dim_Categorization = new HashSet<Dim_Categorization>();
            this.Dim_Collection_Type = new HashSet<Dim_Collection_Type>();
            this.Dim_Municipality = new HashSet<Dim_Municipality>();
            this.Dim_Response_Team = new HashSet<Dim_Response_Team>();
            this.Dim_Ticket = new HashSet<Dim_Ticket>();
            this.Fact_Service_Units = new HashSet<Fact_Service_Units>();
            this.Fact_Service_Units1 = new HashSet<Fact_Service_Units>();
            this.Fact_Ticket_Processing = new HashSet<Fact_Ticket_Processing>();
            this.Fact_Ticket_Processing1 = new HashSet<Fact_Ticket_Processing>();
            this.Initial_Categories = new HashSet<Initial_Categories>();
        }

        public int Audit_Key { get; set; }
        public Nullable<int> Parent_Audit_Key { get; set; }
        public string Table_Name { get; set; }
        public string Package_Name { get; set; }
        public Nullable<System.Guid> Package_GUID { get; set; }
        public Nullable<int> Package_Version_Major { get; set; }
        public Nullable<int> Package_Version_Minor { get; set; }
        public Nullable<System.DateTime> Execution_Start_Time { get; set; }
        public Nullable<System.DateTime> Execution_End_Time { get; set; }
        public Nullable<int> Extract_Row_Count { get; set; }
        public Nullable<int> Insert_Row_Count { get; set; }
        public Nullable<int> Update_Row_Count { get; set; }
        public Nullable<int> Error_Row_Count { get; set; }
        public Nullable<int> Table_Initial_Row_Count { get; set; }
        public Nullable<int> Table_Final_Row_Count { get; set; }
        public Nullable<int> Table_Max_Surrogate_Key { get; set; }
        public string Table_Max_Business_Key { get; set; }
        public Nullable<bool> Processing_Successful { get; set; }
        public string Error_Code { get; set; }

        public virtual ICollection<Business_Partner_Stage> Business_Partner_Stage { get; set; }
        public virtual ICollection<CRM_Ticket_Transaction_Stage> CRM_Ticket_Transaction_Stage { get; set; }
        public virtual ICollection<CRM_Ticket_Transaction_Stage_Cleaned> CRM_Ticket_Transaction_Stage_Cleaned { get; set; }
        public virtual ICollection<Dim_Audit> Dim_Audit1 { get; set; }
        public virtual Dim_Audit Dim_Audit2 { get; set; }
        public virtual ICollection<Dim_Categorization> Dim_Categorization { get; set; }
        public virtual ICollection<Dim_Collection_Type> Dim_Collection_Type { get; set; }
        public virtual ICollection<Dim_Municipality> Dim_Municipality { get; set; }
        public virtual ICollection<Dim_Response_Team> Dim_Response_Team { get; set; }
        public virtual ICollection<Dim_Ticket> Dim_Ticket { get; set; }
        public virtual ICollection<Fact_Service_Units> Fact_Service_Units { get; set; }
        public virtual ICollection<Fact_Service_Units> Fact_Service_Units1 { get; set; }
        public virtual ICollection<Fact_Ticket_Processing> Fact_Ticket_Processing { get; set; }
        public virtual ICollection<Fact_Ticket_Processing> Fact_Ticket_Processing1 { get; set; }
        public virtual GIS_Collection_Stage GIS_Collection_Stage { get; set; }
        public virtual ICollection<Initial_Categories> Initial_Categories { get; set; }
    }
}

This seems to be related to a table column name. 这似乎与表列名称有关。 Make sure that the columns of your database table have safe names (for example, not the same as the name of a SQL data type name). 确保数据库表的列具有安全名称(例如,与SQL数据类型名称的名称不同)。

If you post the table's structure, probably that's going to be obvious. 如果您发布表的结构,可能会显而易见。

Reference: ParseException when adding orderBy attribute to linqdatasource control 参考: 将orderBy属性添加到linqdatasource控件时的ParseException

UPDATE UPDATE

In order to solve your issue, rename the GUID property / column. 为了解决您的问题,请重命名GUID属性/列。

The stack trace, which pointed to 堆栈跟踪,指向

    BatchExtensions.Delete[TEntity](IQueryable'1 source)

and later on to this method : 然后是这个方法

    public static IQueryable 
        Select(this IQueryable source, string selector, params object[] values)

indicates that the exception is raised in the EntityFramework.Extended library. 表示EntityFramework.Extended库中引发了异常。

You'll have to avoid naming your properties as one of the following predefined types (case insensitive): 您必须避免将属性命名为以下预定义类型之一(不区分大小写):

static readonly Type[] predefinedTypes = {
    typeof(Object),
    typeof(Boolean),
    typeof(Char),
    typeof(String),
    typeof(SByte),
    typeof(Byte),
    typeof(Int16),
    typeof(UInt16),
    typeof(Int32),
    typeof(UInt32),
    typeof(Int64),
    typeof(UInt64),
    typeof(Single),
    typeof(Double),
    typeof(Decimal),
    typeof(DateTime),
    typeof(TimeSpan),
    typeof(Guid),
    typeof(Math),
    typeof(Convert)
};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM