This is the webservice method i have
LoadImageFromDB(int ID, ref Stream streamReturnVal)
I have this on the top of the section using Stream = System.IO.MemoryStream;
Whenever i consume this method(update web reference) from a web application, i get this error
'Stream' is an ambiguous reference between 'System.IO.Stream' and 'WebReference.Stream'
Any thoughts?
In webservice class
using Stream = System.IO.MemoryStream;
LoadImageFromDB(int ID, ref Stream streamReturnVal);
In web page where above webservice is consumed:
using WebReference;
Stream streamReturnVal = null;
streamReturnVal = new MemoryStream();
WebserviceInstanceName.LoadImageFromDB(100,streamReturnVal );
PS: Stream - is from System.IO.Stream
So this is caused when you have two namespaces that contain Types with the same name within a single piece of code.
So this section
using Stream = System.IO.MemoryStream;
LoadImageFromDB(int ID, ref Stream streamReturnVal);
should explicitly define what kind of Stream is being passed.
It should probably look something like this
using Stream = System.IO.MemoryStream;
LoadImageFromDB(int ID, ref System.IO.Stream streamReturnVal);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With