Stored Procedure that returns data with Entity Data Model not working
-
Hi. My solution (working in VS 2008) has a C# console app, and a C# web service. The service has an entity data model. It has numerous stored procedures. For one of the stored procs, which just returns data (SELECT blah blah FROM...), I added a function import called "Iservice." I saved all, then in my console app, updated the service reference to my C# service. Now, in my console app, I am trying to do the following:
myEnts db = new myEnts(new Uri("http://localhost:3811/isr.svc"));
foreach(st_service sr in db.Iservice(false))
Console.WriteLine("Number#: {0} " + sr.num);This doesn't work. "Iservice" is the name of the function import I created and I can see it in the object browser, but when I look at the service reference, I can't see it in the object browser. The compiler doesn't like "db.Iservice(false)" and the message is that myEnts from the service reference does not containt a definition for "Iservice." So when I am in the service project, and look at the object browser, I can see Iservice - however when I look at the service reference in the object browser, from the console project, I do not see Iservice. How come this happens? How can I fix this? I tried saving, closing, and reloading MSVS2008, I tried updating the service reference multiple times. I googled for examples of calling stored procs in the EDM, and tried different ways of calling it as shown here: http://blogs.microsoft.co.il/blogs/gilf/archive/2009/03/13/mapping-stored-procedure-results-to-a-custom-entity-in-entity-framework.aspx[^] http://blogs.msdn.com/bags/archive/2009/03/13/entity-framework-modeling-select-stored-procedures.aspx[^] http://blogs.msdn.com/adonet/archive/2007/09/14/how-to-map-stored-procedures-using-the-ado-net-entity-framework.aspx[
-
Hi. My solution (working in VS 2008) has a C# console app, and a C# web service. The service has an entity data model. It has numerous stored procedures. For one of the stored procs, which just returns data (SELECT blah blah FROM...), I added a function import called "Iservice." I saved all, then in my console app, updated the service reference to my C# service. Now, in my console app, I am trying to do the following:
myEnts db = new myEnts(new Uri("http://localhost:3811/isr.svc"));
foreach(st_service sr in db.Iservice(false))
Console.WriteLine("Number#: {0} " + sr.num);This doesn't work. "Iservice" is the name of the function import I created and I can see it in the object browser, but when I look at the service reference, I can't see it in the object browser. The compiler doesn't like "db.Iservice(false)" and the message is that myEnts from the service reference does not containt a definition for "Iservice." So when I am in the service project, and look at the object browser, I can see Iservice - however when I look at the service reference in the object browser, from the console project, I do not see Iservice. How come this happens? How can I fix this? I tried saving, closing, and reloading MSVS2008, I tried updating the service reference multiple times. I googled for examples of calling stored procs in the EDM, and tried different ways of calling it as shown here: http://blogs.microsoft.co.il/blogs/gilf/archive/2009/03/13/mapping-stored-procedure-results-to-a-custom-entity-in-entity-framework.aspx[^] http://blogs.msdn.com/bags/archive/2009/03/13/entity-framework-modeling-select-stored-procedures.aspx[^] http://blogs.msdn.com/adonet/archive/2007/09/14/how-to-map-stored-procedures-using-the-ado-net-entity-framework.aspx[
dfn wrote:
"Iservice(bool?)" which is strange to me. Why the question mark?
I think that it is treating it as nullable. Apart from that, I am lost.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
Hi. My solution (working in VS 2008) has a C# console app, and a C# web service. The service has an entity data model. It has numerous stored procedures. For one of the stored procs, which just returns data (SELECT blah blah FROM...), I added a function import called "Iservice." I saved all, then in my console app, updated the service reference to my C# service. Now, in my console app, I am trying to do the following:
myEnts db = new myEnts(new Uri("http://localhost:3811/isr.svc"));
foreach(st_service sr in db.Iservice(false))
Console.WriteLine("Number#: {0} " + sr.num);This doesn't work. "Iservice" is the name of the function import I created and I can see it in the object browser, but when I look at the service reference, I can't see it in the object browser. The compiler doesn't like "db.Iservice(false)" and the message is that myEnts from the service reference does not containt a definition for "Iservice." So when I am in the service project, and look at the object browser, I can see Iservice - however when I look at the service reference in the object browser, from the console project, I do not see Iservice. How come this happens? How can I fix this? I tried saving, closing, and reloading MSVS2008, I tried updating the service reference multiple times. I googled for examples of calling stored procs in the EDM, and tried different ways of calling it as shown here: http://blogs.microsoft.co.il/blogs/gilf/archive/2009/03/13/mapping-stored-procedure-results-to-a-custom-entity-in-entity-framework.aspx[^] http://blogs.msdn.com/bags/archive/2009/03/13/entity-framework-modeling-select-stored-procedures.aspx[^] http://blogs.msdn.com/adonet/archive/2007/09/14/how-to-map-stored-procedures-using-the-ado-net-entity-framework.aspx[
dfn wrote:
Iservice(bool?)
? is appended to value types to make them nullable; so bool? is either true, false, or null. :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
dfn wrote:
"Iservice(bool?)" which is strange to me. Why the question mark?
I think that it is treating it as nullable. Apart from that, I am lost.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
Henry Minute wrote:
I am lost
Have a break. You probably have just exhausted your brain cell with a though FLP problem. :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
Henry Minute wrote:
I am lost
Have a break. You probably have just exhausted your brain cell with a though FLP problem. :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
Hi. My solution (working in VS 2008) has a C# console app, and a C# web service. The service has an entity data model. It has numerous stored procedures. For one of the stored procs, which just returns data (SELECT blah blah FROM...), I added a function import called "Iservice." I saved all, then in my console app, updated the service reference to my C# service. Now, in my console app, I am trying to do the following:
myEnts db = new myEnts(new Uri("http://localhost:3811/isr.svc"));
foreach(st_service sr in db.Iservice(false))
Console.WriteLine("Number#: {0} " + sr.num);This doesn't work. "Iservice" is the name of the function import I created and I can see it in the object browser, but when I look at the service reference, I can't see it in the object browser. The compiler doesn't like "db.Iservice(false)" and the message is that myEnts from the service reference does not containt a definition for "Iservice." So when I am in the service project, and look at the object browser, I can see Iservice - however when I look at the service reference in the object browser, from the console project, I do not see Iservice. How come this happens? How can I fix this? I tried saving, closing, and reloading MSVS2008, I tried updating the service reference multiple times. I googled for examples of calling stored procs in the EDM, and tried different ways of calling it as shown here: http://blogs.microsoft.co.il/blogs/gilf/archive/2009/03/13/mapping-stored-procedure-results-to-a-custom-entity-in-entity-framework.aspx[^] http://blogs.msdn.com/bags/archive/2009/03/13/entity-framework-modeling-select-stored-procedures.aspx[^] http://blogs.msdn.com/adonet/archive/2007/09/14/how-to-map-stored-procedures-using-the-ado-net-entity-framework.aspx[