Can my WebMethod return an XmlDocument as return type?
When I try to consume the web service I'm still not getting XML. It appears as though a reference to the method is being returned rather than say a string containing XML.
<WebMethod()> _ Public Function CustomerSearch(ByVal lastName As String, ByVal firstName As String, ByVal companyName As String, ByVal city As String, ByVal state As String, ByVal email As String) As XmlDocument ' Create XML doc Dim doc As XmlDocument = New XmlDocument() ' some more code Return doc End Function
I have a web service and its methods return a class which is name WSResult. WSResult has 2 properties. One of property's type is int and the other one's type is object. I want to return some different type with this second property.
How can i pass an object which i retrieved from other web services or that i generated from my serializable classes inside M_ResultObject property ?
I have create a table and create edmx file, and I create a Stored Procedure that return a single row (select by primary key), and I want the edmx to have a function that calls that SP and return a type.
I am consuming an RSS feed to display on my website using a repeater control. I was wondering if it's possible in VB to return an anonymous type from my linq query rather than a collection of strongly typed RSSItems. I know this is possible in C#, however haven't been able to work out a VB equivalent.
my controller, I'm generically deserializing Xml. The object being deserialized to could end up being any number of different types. This, of course, won't be known at compile time. I've created a number of partial views, each of which are strongly typed to a different object that is a possible outcome of the Xml deserializaton.My problem is that I'm struggling with a good way to return the right view. I could always switch on some property in the object, or use a Key/ViewName Dictionary mapping to get the right view name, but I was hoping for something a little more generic than that.Does anyone know of a way that I could implicitly say, "return the view that is typed off of the object I have."?
If I have Database Stored Procedure retrun Complex type (Contain from Columns for 2 tables) ( Composite) and No Relation between them so i can't use Navigation Property ... so how can I use That in ADO.NET Framework specially when i try to use Add Function Import i didn't find any thing else None, Scalars, Entites.
I've recently inherited an ASP.NET 2.0 project from other developers and they have a LinqToSql datacontext with stored procedures. I've been asked to modify one of the SPs which is essentially just adding a couple columns to the database table and then those to parameters to the SP. So I delete the existing SP from the L2S context and drag in the new one with the additional fields, and all hell breaks loose. Suddenly I get over 20 errors! What seems to have occured is L2S has modified many other stored procedures that I haven't even touched and changed the return type from ISingleDefault<some object> to int. I've never used stored procedures before with L2S so I don't know if this is standard behavior or not. Does anyone know why this has happened and how to fix it to set the correct return type?
I have the following statement, I want to turn it into a Public Shared Function :
If isEmployee Then Dim employeeInstance As New Employee employeeInstance = GetEmployeeInstanceByUserId(userId) Return employeeInstance Else Dim studentInstance As New Student studentInstance = GetStudentInstanceByUserId(userId) Return studentInstance End If
Public Shared Function GetWorkerInstance(Byval isEmployee as Boolean) As ...(not sure what to write here)...
There two possible return Type. I'm not sure what I should declare for the function return type.
I have a webservice - called MyCompany.WebService1
I reference this using a web reference in my ASP.net web application.
Theres a method called "GetDeal" in this web service, that returns a "Deal" Object.
The deal object currently looks (for example) like this:
This class is in a different assembly: MyCompany.Model
The web service references this assembly.
In my web app, I can call the GetDeal method. This returns Service1.Deal (service1 is just the name of the web reference)
I can access both properties above. I have now changed the Deal class, and added a couple more properties.
However, I can't see these new properties in my web application. I've updated the web service in the web application. I rebuilt the web service several times, tried removing the MyCompany.Model reference and re-addding it etc...
I can't figure out what has changed... This was working - I have changed the model before, and it's updated the reference correctly...
I am trying to fill a gridview with the data from Product table selecting few columns . I am using 3 - tier architecture and in DAL getproduct(userid) I am writing the query but cannot figure out exactly how to get that working .. here is piece of method I wrote
public AuthenticationResult Authenticate(Enum type, string userName, string password) But the problem I had is that if a null/invalid enum is entered for the type variable it throws an error message.
So the obvious solution is to use a string/int instead but I am cannot do this as current users already use the existing webmethod.
So i was thinking:
public AuthenticationResult Authenticate(object type, string userName, string password) and handling the casting myself but the problem I had with this is that now my users do not have access to the Enum type.
So my question is can I publish the enum type without having it as a parameter/return value? Allow the client to access the Enum so they can pass it into the method. Would using a method that returned a type that was my enum work? Or is there a way to catch this custom error: (I dont think so as it appears to be on the client end when converting Enum to xml). The error is: (System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: Instance validation error: '45465' is not a valid value for Enum.)
I just hit the following issue: I am calling a web service that returns a serialized JSON object let's say: __type, FirstName, LastName (.net object Person with properties FirstName and LastName). __type's value is Test.Person
I have created a JS object using Type.registerNameSpace/registerClass called Demo.Person and it is registered on the page using the ScriptManager. Everything is working fine; I am able to get data from the server on the call back.
I want to create a function which would have two parameters
public **XYZ** GetOputput(string strToConvert, **ABC**)
What I want from this function, that I will send a string to this function and the datatype in which I want to convert this string [Ex: Int32,Int64, datetime etc..] and the return will be the same as the datatype I have sent as the input parameter.
I want to have something like this in my function:
I have a stored procedure in SQl and i am calling through Entity framework through import functions. Stored procedure is returns columns from 2 different tables.. now what should be return type at Entity framwork end ?
I've googled a bit for the exact order of all gridview events relative to and where inbetween page events. The only Microsoft article: [URL] is not very clear. I'm especially interested in the gridview row_command event relative to page events.