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:
This doesn't work. "Iservice" is the name of the function import I created and I can see it in the object explorer, but when I look at the service reference, I can't see it in the object explorer. The compiler doesn't like "db.Iservice(fa lse)" 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 explorer, I can see Iservice - however when I look at the service reference in the object explorer, 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:
I'd appreciate any help.
PS -- I mean object browser, not explorer, sorry. Also, the stored proc that I created a function import for takes in a BIT as a parameter. When in my service project, and looking at the object browser, it shows Iservice as "Iservice(bool? )" which is strange to me. Why the question mark?
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_serv ice sr in db.Iservice(fal se))
Console.WriteLi ne("Number#: {0} " + sr.num);
foreach(st_serv ice sr in db.Iservice(fal se))
Console.WriteLi ne("Number#: {0} " + sr.num);
So when I am in the service project, and look at the object explorer, I can see Iservice - however when I look at the service reference in the object explorer, 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:
I'd appreciate any help.
PS -- I mean object browser, not explorer, sorry. Also, the stored proc that I created a function import for takes in a BIT as a parameter. When in my service project, and looking at the object browser, it shows Iservice as "Iservice(bool? )" which is strange to me. Why the question mark?