"The container 'XXXX' supplied for the FunctionImport could not be located in the current workspace," says an Entity Framework error.

entity-framework stored-procedures

Question

I'm carrying this out.

            EntityConnection entityConnection = (EntityConnection)context.Connection;
        EntityCommand command = entityConnection.CreateCommand();
        command.CommandText = "Genesis.AL_Insert";
        command.CommandType = CommandType.StoredProcedure;

        //Parametro de NombrePlantilla
        EntityParameter nombrePlantillaParameter = new EntityParameter("NombrePlantilla", DbType.String);
        nombrePlantillaParameter.Value = lote.Plantilla.Nombre;
        command.Parameters.Add(nombrePlantillaParameter);

        //Parametro de LoteId
        EntityParameter loteIdParameter = new EntityParameter("LoteId", DbType.Guid);
        loteIdParameter.Value = lote.LoteId;
         command.Parameters.Add(loteIdParameter);


       // Parametro de Secuencia
        EntityParameter secuenciaParameter = new EntityParameter("Secuencia", DbType.Int32);
        if (secuencia > 0) {
            secuenciaParameter.Value = secuencia;
        }
        else {
            secuenciaParameter.Value = 0;
        }
         command.Parameters.Add(secuenciaParameter);


        //Parametro de UsuarioId
        EntityParameter usuarioIdParameter = new EntityParameter("UsuarioId", DbType.Guid);
        usuarioIdParameter.Value = usuario.UsuarioId;
         command.Parameters.Add(usuarioIdParameter);

        //Parametro de Estacion
        EntityParameter estacionParameter = new EntityParameter("Estacion", DbType.String);
        estacionParameter.Value = estacion;
         command.Parameters.Add(estacionParameter);

        //Parametro de ActividadId
        EntityParameter actividadIdParameter = new EntityParameter("ActividadId", DbType.Guid);
        actividadIdParameter.Value = actividad.ActividadId;
         command.Parameters.Add(actividadIdParameter);

        //Parametro de Descripcion
        EntityParameter descripcionParameter = new EntityParameter("Descripcion", DbType.String);
        descripcionParameter.Value = descripcion;
         command.Parameters.Add(descripcionParameter);

        //Parametro de ValoresAnteriores
        EntityParameter valoresAnterioresParameter = new EntityParameter("ValoresAnteriores", DbType.String);
        valoresAnterioresParameter.Value = valoresAnteriores;
         command.Parameters.Add(valoresAnterioresParameter);

        //Parametro de ValoresNuevos
        EntityParameter valoresNuevosParameter = new EntityParameter("ValoresNuevos", DbType.String);
        valoresNuevosParameter.Value = valoresNuevos;
         command.Parameters.Add(valoresNuevosParameter);

        command.ExecuteNonQuery();

and I encounter this issue:

 "The container 'XXXX' specified for the FunctionImport could not be found in the current workspace."
1
5
10/5/2009 3:51:25 PM

Accepted Answer

This error suggests that your entity framework model needs to be fixed.

It may also be that it does not like the "." in the stored procedure name.

See: for details on function imports.

http://msdn.microsoft.com/en-us/library/bb896231.aspx

3
10/8/2009 7:36:01 PM

Popular Answer

The connection string was the solution for me when I had the similar issue. I chose the incorrect model route.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow