The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

The multi-part identifier could not be bound exception with es 2007.1.1119.0

Last post 12-04-2007, 4:17 AM by paschoal1. 3 replies.
Sort Posts: Previous Next
  •  12-03-2007, 3:20 PM 6966

    The multi-part identifier could not be bound exception with es 2007.1.1119.0

    Hello,

    When moving to version 2007.1.1119.0 I discovered a problem.
    I made a sample project from scratch using Northwind database just to be sure.

    With previous version I used to do something like that :

    Code:
                EmployeesCollection employees = new EmployeesCollection(); 
                employees.Query.Select(new string[] {"LastName"}); 
                employees.Query.Load(); 
    
    
    Whith the latest version it produces the following exception :
    "The multi-part identifier \".LastName\" could not be bound."

    The content of the es.lastQuery is as following :
    SELECT .[LastName]  FROM [Employees].
    Note the dot preceding [lastname] witch produces the exception.

    Please tell me if there is a workaround.

  •  12-03-2007, 5:38 PM 6969 in reply to 6966

    Re: The multi-part identifier could not be bound exception with es 2007.1.1119.0

    Is there any reason you don't use Query.LastName in the select? I'm confused having never seen that syntax before? As a work around try "<LastName>" but that still is in no way how we intended it be used?

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  12-04-2007, 2:28 AM 6975 in reply to 6969

    Re: The multi-part identifier could not be bound exception with es 2007.1.1119.0

    The reason I don't use Query.LastName is because fields for populating the select are computed in a different part in the project, and passed to the method under a List<string> parameter containing the field names.

    But your workaround is working perfectly.

    Thanks.

  •  12-04-2007, 4:17 AM 6976 in reply to 6975

    Re: The multi-part identifier could not be bound exception with es 2007.1.1119.0

    Hi, Maybe what you you want is this:

    Code:
    1    		public virtual bool LoadByPrimaryKey(List fieldsToReturn, System.Int32 idCliente)
    2    		{
    3    			esQueryItem[] fields = fieldsToReturn.ToArray();			
    4    			esClienteBolsaQuery query = this.GetDynamicQuery();
    5    			query
    6    			    .Select(fields)
    7    			    .Where(query.IdCliente == idCliente);
    8    			return query.Load();						
    9    		}
    10   
    
     
    idCliente is the key of the Table
    To use it you add the fields you want to the List and call the function,
     Code:
    1                        Cliente cliente = new Cliente();
    2                        List campos = new List();
    3                        campos.Add(cliente.Query.Name);
    4                        campos.Add(cliente.Query.Description);
    5                        campos.Add(cliente.Query.Adress);
    6                        cliente.LoadByPrimaryKey(campos, idCliente);
    7    
    
     
View as RSS news feed in XML