Public Structure In Web Service As Return Value In Function

Sep 24, 2010

I have a windows app that references a web service I created. In the web service, I created a function that needed to return more than one value. Because of this, I created a public structure in the web service:
Public Structure MyRecordSet
Public lstOfDataInRecord As List(Of String)
Public iNumberOfRecords As Integer
End Structure

Here's the function - the return value is MyNewRecordSet:
Dim MyNewRecordSet As MyRecordSet <WebMethod()> _
Public Function GetDataReturnList(ByVal sql As String, ByVal sTableName As String) As MyRecordSet
MyNewRecordSet.lstOfDataInRecord = New List(Of String)
[Code] .....
Anyway, I see it's a conversion issue, but not sure how to resolve it. This is my first attempt to use a public structure in a web service and receive a return on it from my app.

View 1 Replies


ADVERTISEMENT

Public Function & Structure - Return Two Integers

Nov 25, 2010

I am trying to do a simple program where I have a public structure and public function in a code file, the problem is I want to return two integers. Here is the code from my code file.

[Code]...

View 7 Replies

Function Return An Array Of A Certain Structure?

Apr 24, 2012

I've this code, but there is a problem with setting values. I get "null object" error. how to work properly with functions.

Public Structure Results
Dim Nickname As String
Dim Result As Integer

[Code].....

View 5 Replies

VS 2005 Function Return Structure Value

Dec 22, 2009

I want my function to return a value of a structure. The function is supposed to change the values and then return the answers in one structured value. Here is my code... as you can see it does not work... it needs a LOT of things. I placed question marks were i am really lost.

[Code]...

View 13 Replies

What Is The Correct To Return A Structure From A Function

Nov 21, 2010

Say I do this

Public Function CheckWebCamVF() As BusinessProfilesBO.VFCheck
checkwebcamVF.isactive = true
return checkwebcamVF

[code].....

I seem to be getting null referance errors using the first one.I am trying to get my code as fast and as correct as possible

View 3 Replies

[Public Sub / Public Function] Equals [Sub / Function] Declaring A Function Or Sub?

Jun 12, 2011

I want to know what implies to declare a function or a sub using public or directly Sub / Function i.e.:

Public Function Whatever()
' Process
End Function

versus.

Function Whatever()
' Process
End Function

View 4 Replies

Difference Between Public Sub And Private Sub And Private Function And Public Function And Sub And Shared Function?

May 31, 2011

explain me the difference between them? I'm new to visual basic, and I need to know the very basic things in Visual Basic allowing me to become a professional User

View 8 Replies

Loop Through Public Structure And Pass To Generics?

May 8, 2012

I have inherited some god awful vb.net code and having trouble trying to work out the generics for looping through the current structure in place.

here is a snippet of the struct

Public Structure ApplicationDetails
Dim ID As Integer
Dim AgentID As Integer

[Code]...

but i am not sure on the syntax to set the value and when trying to get the type i get item.GetTYpe() is not declared.

View 2 Replies

How To Return A Structure-VB Code

Mar 13, 2009

I am trying to return a structure from a class.vb file to an aspx page. Is this possible, if so how would you do it in the aspx page and the class.vb file?

View 1 Replies

Returning A Structure From A Web Service?

Jan 15, 2009

I am trying to return a structure from one of my web services. It throws up this error:

Quote:
Exception Details: System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. --->

[code].....

View 15 Replies

Return Public Class Readonly Property

Feb 13, 2009

I have created a class called clsLogIn [code]Now I am on a different form, frmSchedule, and I want to get the ProviderNum property from clsLogin into a text box.

View 10 Replies

Return Values With Reference Arguments Or By Structure?

Jul 10, 2009

In what situtations is it best to use reference arguments to return values?

Sub Example(byref value as integer)
value = 3
End Sub

In what situations is it best to return the value (perhaps in a structure for more complex types)?

Function Example() as integer
return 3
End Function

View 3 Replies

Public-facing Property To Return Either A String OR A Numeric W/o Using 'Object'?

Nov 4, 2010

So I've run into a case where I have a class that can store either a string or a numeric value, and I want a single property to return one or the other (it would be a failure for both to be set). I'm using a custom generic class to deal with the numerics (so I can use signed, unsigned, and nullables), and will be storing the string in a separate variable.

In theory, if overloading could be done based on the return type, I could do this quite easily. But .NET currently disallows this. So I am wondering if there is some other really-far-out-there trick (outside of MSIL generation via Reflection.Emit) that could accomplish the same thing.

I'm open to ideas via delegates, pointer dereferencing, generics, mystical rites, etc. Also interested in any thoughts or pros/cons of such possibilities as a learning tool. If using a standard Object is the only way to achieve what I want, then that's fine with me. But It's difficult to find the correct set of keywords to hunt down this kind of capability on Google, so I thought I'd ask here before I moved on to doing something else on the project.

View 2 Replies

Class Definition To Return Nested JSON Structure Without WCF?

Dec 10, 2011

I'm trying to return code like this (can be found here):

{"hotspots": [{
"id": "test_1",
"anchor": { "geolocation": { "lat": 52.3729, "lon": 4.93 } },

[code].....

View 2 Replies

Take Some Existing Classes We Retrieve From A Web Service And Hiding Public Functions?

Nov 18, 2009

[code]...

EDIT: The above class is just an example of what could be returned from a web service. I won't have access to modify it at all, sorry if I didn't make that clear.Is it possible to somehow make a clone this class, so that it retains all of the properties values, but hides the fact that there is a Public function?I'd like to be able to take some existing classes we retrieve from a web service(which we didn't write) and be able to pass them on for use in an application, but without exposing the functions. I don't want to go down the route of creating my own classes that specifically define each property and write the values in (due to the sheer size of some of them), so I'm looking to see if there is anything dynamic I can utilise (maybe there is a way using reflection?).

View 4 Replies

Error1'Public ReadOnly Property Right() As Integer' Has No Parameters And Its Return Type Cannot Be Indexed

Jun 19, 2010

I am trying to use the right function in VS 2008. I am simply trying to get the right 5 characters of a string.

VendorID = Right(cboVendors.Text, 5)

I am getting an error when I type that:

Error1'Public ReadOnly Property Right() As Integer' has no parameters and its return type cannot be indexed.

View 3 Replies

Return Xml In A Vb Web Service?

Feb 3, 2010

i have a paragraph which is then broken into sentence. i want to return all the sentences in a xml format. my sentences are stored in an arrayList

View 2 Replies

Return An (Anonymous Type With A Function) From A Function?

Mar 3, 2011

Just so it's known, this question is mostly academic, even though I tried to use the concept in a real-world solution. I realize the example is contrived, but I believe the concept is valid.I want to write some fluent code like this:

[code]...

I realize that I can't force an anonymous type into a specific type (like implementing an interface or some other class), and I don't want the overhead of defining a specific class just to match my desired fluent name with the actual method name. So I was able to make the code work like this:

copy(my_first_file).to.Invoke(my_second_file)So there is no IntelliSense or type awareness there, and I have to include the Invoke in order to have the method run. How can I get more type safety and exclude the Invoke method, under these constraints: Anonymous Type returned from Method No additional classes or interfaces Preferably, I do not want to pass in another parameter to the copy() method that tells what type to return, unless copy becomes a generic method (but I think that means defining another class/interface, which I don't want to do)

View 3 Replies

.net - How To Call Public Function

Nov 22, 2011

I have a public function to call default email client.Public Function OpenEmail(ByVal EmailAddress As String, Optional ByVal Subject As String = "", Optional ByVal Body As String = "") As Boolean

[Code]...

View 1 Replies

How To Call Public Function

Apr 18, 2011

I have a public function to call default email client.

Public Function OpenEmail(ByVal EmailAddress As String, Optional ByVal Subject As String = "", Optional ByVal Body As String = "") As Boolean
Dim bAns As Boolean = True

[code].....

View 6 Replies

Public Function On The Listbox's

May 15, 2009

Here's what i would like to know, i will post my layout below.

CODE:

Right what i want to do is when i click my button it goes to the timer3.tick.. i then want it to use the public function on the listbox's.

View 39 Replies

.net - Android App Won't Return Result From WCF Service

Dec 1, 2010

here is my WCF server code (VB.NET)...

Service1.svc
Public Class Service1
Implements IService1

[code]....

For some unkown reason, I can run the VS 2010 client test and it the WCF host works fine. The code above just returns nothing (it's supposed to return a string)

View 1 Replies

Deserialize A Xml File That Is Being Return From A Web Service?

Feb 4, 2010

my xml has many parent with 2 child in them. how can i deserialize them into an arrayListnavarrowee?

View 7 Replies

Web Service Return Complextype Class

Jun 26, 2012

i have the web service that return a class Dto the name of the service is GetDto and the element of the class that return are Id and name.

how to manage a return class from web service?

View 5 Replies

.net - Call Public Function In Another Application?

Oct 15, 2009

If I have a Windows Application WinApp that has a public function pubFun, how can I call it from a different windows application --> WinApp.pubFun() ?

View 2 Replies

Argument Not Specified For Parameters Of Public Function

Feb 19, 2011

I have to create a program that finds the total cost for pizza, fries, and soft drinks, and places that in a list box. So far, though, I'm stuck. I have this code so far:

Public
Class frmBill
Private
Sub btnTotal_Click(ByVal
sender As System.Object,
[Code] .....

The errors that I am getting are:
"Argument not specified for parameter 'D' of Public Function totalBill(P As Double, F As Double, D As Double)
"Argument not specified for parameter 'F' of Public Function totalBill(P As Double, F As Double, D As Double)
"Argument not specified for parameter 'P' of Public Function totalBill(P As Double, F As Double, D As Double)"

View 3 Replies

Control Contains A Public Function LoadControl?

Apr 27, 2011

For example we generally apply threading to make application faster and unnecessary timetaking not related to UI things can go in secondary threads.Now If I have a user control

This control contains a public function LoadControl() Function is called from the form which is using the user control In side function

[Code]...

View 1 Replies

Creating Public Function / Sub To Set CSS And Other Properties

Jan 11, 2011

I am trying to create a Public Sub / Function that will allow me to pass certain variables into it and this will affect the output. e.g.
DIV ID = InfoDiv
CSS Class = "Warning"
LBInfoMsg.Text = "An Error has occured"
DIV Visibility = True or False

I would like to type something similar in the code behind page:
InfoMsg(InfoDiv, "warning", "An Error has Occurred", True)

Public Sub InfMsg(ByRef MyDIV As System.Web.UI.HtmlControls.HtmlGenericControl, ByRef CSS As System.Web.UI.WebControls.Style, ByVal strMessage As String)
strMessage = strMessage.Replace("'", "''")
MyDIV.Attributes.Add("Style", "warning")
MyDIV.Visible = "True"
End Sub

View 1 Replies

Is It Possible To Hide A Public Subroutine / Function

Oct 29, 2009

Class A gets, as part of it's constructor, a pointer to class B and saves that pointer in a private variable. Class B exposes a public function, F. I'd like for class A and all classes that inherit from class A to NOT be able to call B.F.The idea is that class A will implement its own version of F, one that calls B.F, but the rest of the code should not be calling B.F. If it matters, the two have different function signatures.Maybe another way, like a class C that inherits from class B and hides the public functions? (Cant that even be done?)

View 2 Replies

Public Function On Default Page Or Somewhere Else?

Aug 30, 2009

I have a public function declared in my code-beside on default.aspx.vb. I needed to add a second page to my project and copied and pasted that function into the second page, but when I test the page I get an error saying there's a conflict with the same public function on the default page.

If I remove the function from the second page, i don't get the error, but will it still be accessible if called on that page, even though it's on the default page? Or do I need to place it somewhere else so that it's accessible to both pages?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved