Using DevForce Silverlight version 5.1.1.0 beta, I have a SL 3 beta project that was created from the DevForce templates (so 2 projects in the solution). The database is SQL Server 2008.
I'm trying to load an Entity from a stored procedure where the procedure doesn't return a real entity (in this case, it returns a generated key value). I've gone so far as to define an actual database table so I can create an entity type from it (rather than creating the 'fake' table in the edmx) that has an integer key field along with the other fields that match the select statement from the proc.
The proc doesn't use a RETURN value (since that doesn't seem to work with EF/DevForce) and it just returns local variables in a select statement (just to test this concept out).
The entity is defined exactly the same as the select statement (same column names; same datatypes). I've added the function import in the edmx and it's set to return an entity of the type. I've even tried inserting the row into the db table from the procedure and then just retrieving from it.
The problem is that with an Async query, the procedure executes but the entity doesn't get loaded with the data.
Since Silverlight needs to run this ASYNC, I build the query using the StoredProcQuery and then I use ExecuteQueryAsync to run it (I have an event handler for the callback with the right event args):
StoredProcQuery query = EntityManager.GetNewKeyQuery('Test', 1);
EntityManager.ExecuteQueryAsync (query, callback, null);
The proc physically runs on the db (I see it in SQL Profiler) but no data exists in the event args once the callback handler is invoked. It acts like it returns control to the handlre before the results are available.
Any thoughts?
|