IDE :: Returning An Array Values?

Dec 1, 2009

i have this code:

...
Dim Labels() As String
Dim Count As Integer
Count = 0

[code].....

View 3 Replies


ADVERTISEMENT

Class Not Returning Values?

Oct 15, 2010

i have this class that i'm calling from a telerik report. when debugging asp.net application the report shows the right results but when i deploy to IIS it just return the first row and not the SUM of the salary variable.

Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data

[code]....

View 2 Replies

Code Returning Different Values ( C# And .NET )

Dec 2, 2010

VB.NET Code:

Module Module1
Sub Main()
Dim x, y As Single
x = 0 + (512 / 2 - 407) / 256 * 192 * -1

[code].....

returns 0: 0

View 2 Replies

Returning One Or More Values From A Function?

Apr 20, 2010

Is it possible to return more than one value from a function? Like two integers, or an integer and a boolean, or any other data type combination. I understand I could use a sub and set these values in a variable but I was wondering if I could avoid declaring more variables by using a function.

View 28 Replies

Returning Values In Another Class?

Jul 31, 2009

I'm making this game where there is an enemy that goes to the center of the form and grabs an object and brings it back to the side. I made a new class called enemy that makes the enemy. in the class there is a sub called start which the enemy goes to the center and brings the object back. when the enemy comes back with the object i want the integer lives to subtract 1 from it. so i put the

If Not Rect.IntersectsWith(Form1.ClientRectangle) Then
Form1.Lives -= 1
End If

where Rect is the enemy's bounds. when ever rect is not intersecting with the forms bounds (which means when its off screen) lives should subtract 1, but it doesnt.

View 5 Replies

.net - Inherited Classes Returning Different Values?

Jun 25, 2010

This is more of a conceptual question than anything.

I have a base class called "RawReader".

It sets up the framework for classes to inherit it and read in specific data systems.

For example, I want an app read in a known format of FoxPro database, a CSV file, or a SQL database (there is about 8 more formats currently), then transfer it over a webservice and create a SQL database from it.

I have everything working with CSV, FoxPro, Access, Excel, etc... Easy enough.

The classes that inherit RawReader, like RawCSV, RawFoxPro, RawAccess all return a struct that contains a dataset as one of the members. The dataset contains the data from the raw system. The webservice receives this struct and creates sql tables and loads the data into it. This has already been coded and works great.

My issue now comes to reading in SQL. Obviously, I could follow the same path, read the remote SQL DB into a dataset, transfer the dataset as above, etc... My "issue" comes in where I feel like it doesnt make much sense to transfer a SQL db to a dataset, transfer it through the webservice, and then try to programmatically recreate the SQL database. I feel like I lose a lot of the granular details from the SQL database (field sizes, extended info, etc..) It seems easier in practice to just create a backup of the database, convert it to a stream object and transfer the backup over to the webservice. But this is where the problem lies...

Since all of the classes inherit from the base class, they are set up to return a DataSet. The hack-ish way would be to just add a stream object to the return struct and in my webservice add other code to make a special case for SQL sources, but I was trying to avoid that.

Any thoughts on the "proper" way to go about something like this?

View 1 Replies

Class Not Returning Accurate Values?

Oct 15, 2010

look at this class and say why it's just returning just the first row in the second query, the issue is that the Salary is showing the right value when debugging, but when deployed to IIS it's just returning the 1st row

Imports System
Imports System.Collections
Imports System.ComponentModel

[Code].....

View 1 Replies

Function Is Not Returning Correct Values

Jun 18, 2009

Ok simply my code doesnt want to output the correct number. I'm working on the project euler probems to expand my knowledge in VB.net and the current question I am working on is asking to work with triangle numbers. while researching I found that a triangle number can be calculated by using the formula:

[Code]....

View 5 Replies

Idatareaders Not Returning Values From Database?

May 25, 2010

In my codebehind I have this vb:

Dim reader as idatareader = includes.SelectDepartmentID(PageID)
While reader.Read
Did = reader("departmentid")

[Code].....

No Errors are being presented yet nothing is being returned by the reader. Is there an error in my code?

View 2 Replies

Returning Multiple Values From Function

Mar 17, 2009

I am working on a project I would like to use a function in a class I created to return multiple values in order to populate a listbox. I wanted to use a do until loop to achieve this. I will just post a simplified example of what I am doing :

Public Function Listboxfiller
Dim astring As String = "This is a string"
Dim Counter as integer = 0
Do until Counter = 5
return astring
Counter += 1
Loop

Then on the form I would do something like :
lstListbox.Items.Add(Myclass.Listboxfiller)

What happens right now is that the listbox only gets the first value, when I ran through in debug mode I found the loop only runs once, even though it should go multiple times.

View 4 Replies

WCF Service Not Returning Current Values?

Sep 27, 2009

I created a WCF Service running as a console application. It is doing event listening for my workflow engine.The second application I am trying to do is a WinForm that can monitor the service and return me back the current states of the engine's workersI am able to connect to the service fine, and I verified that my service has values being set when I step through it... however when my monitor makes a call to the service, I am returning values as though it is not being run? (So default values, not current values

View 13 Replies

Web Services And Returning Multiple Values

Jan 14, 2009

I am struggling here with introducing web services into a site I am currently working on. The background is as follows.

- I have a page switchboard.vb which will recieves incoming xml requests.
- I parse these xml requests extracting its values, then setting them equal to the relevant global variables in switchboard.vb.
- One of these variables will determine a 'requestType'. Based on this requestType I want the page to call particular web services that I will add.
- These web services will then validate the user calling has permissions to access and execute it.
- The switchboard.vb page will then generate an xml respose which will post to the client.

Here is a summary of the process
getXML()
parseXML()
determineRequestType()
executeRequest()
rebuildXML()
postXML()

The ways I can see to do this are:
1. Pass the variables into the required Function allowing it to pass back a pre formatted xml string.
Pro: Simple
Con: It is not really using the web service as it should be.

2. Pass the variables into the required Function as 'ByRef' values hense changing the original value on switchboard.vb
Pro: allows me to format the outgoing xml on switchboard.vb and gives me more functionality with more individual variables as opposed to one string being passed back.
Con: Is this taking advantage of a web service? When I tried this the web service form didnt give options to input test data. Possibly because I am using ByRef?

View 10 Replies

Returning Multiple Values From A Function Call?

Apr 1, 2010

I have an active directory search function:

Function GetAdInfo(ByVal ADDN As String, ByVal ADCommonName As String, ByVal ADGivenName As String, ByVal ADStaffNum As String, ByVal ADEmail As String, ByVal ADDescription As String, ByVal ADTelephone As String, ByVal ADOffice As String, ByVal ADEmployeeID As String) As

[code].....

View 1 Replies

Asp.net - Returning Multiple Values From A Function In An Parcial Class In VB?

Sep 6, 2011

show me how to return multiple values from a function? I have my function in a seperate file within App_Code and here it is:Public Function GetQuoteStatus(ByVal QuoteID As String) As String

Dim quoteStatus As String
Dim con As New SqlConnection
Dim cmd As New SqlCommand
Try
con.ConnectionString = ConfigurationManager.AppSettings("quotingSystemConnectionString")
con.Open()

[Code]...

However this is all good and well for one returned value but what If I wanted to return multiple values.How do I access them?

View 3 Replies

SQL Possibly Not Returning Values For A Query In Visual Basic?

Jun 29, 2010

In my code I enter a string in a text box and have the query check the server for the entry. If it exists it returns the string and the date into two separate variables. The database only has TrackingNumber and Date. Below is the code. As of right now i get "Invalid attempt to read when no data is present." at the "If (sdr("TrackingNumber") IsNot Nothing) Then" line.

Public Function CreateSqlParameter(ByVal name As String, ByVal dbType As DbType, ByVal direction As ParameterDirection, ByVal value As Object) As SqlParameter
Dim parameter As SqlParameter = New SqlParameter()

[Code]....

View 3 Replies

Returning An Array From A Function

Apr 14, 2009

I need to return an array but the array size will change from one call of the function to another so I need away to storing the returned array. The function is as below, and as you can see the returned array will be of different sizes:

[Code]...

View 4 Replies

Returning Array From Function

Jan 15, 2010

Im overiding getRolesForUser() I have 2 columns i return from the query IAdapter.GetRolesByUserName(userName) returns two columns (roleID, formID) How can I return them and access the two columns data? 2 dimensional array?

[Code]....

View 6 Replies

VS 2010 - Reading Text File And Returning Values To Textbox

Apr 17, 2011

I've a got a homework assignment that chooses one of four values in a list box, stores it in a text file. Secondly, on the display click event it should access the text file, read the line, store it in a variable and then display the totals in a text box. Works sort of fine except that it doesn't display the totals correctly. Code for both buttons is below. The variable are assigned in the mainform (Tried also in the display button and didn't change anything). The save button works fine and stores fine in the text file, it's just the reading that's the problem.

Private Sub saveButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles saveButton.Click
'save the new vote choices to a file
Dim votes As IO.StreamWriter
votes = IO.File.AppendText("votes.txt")
Dim voteSelected As String = CStr(commercialListBox.SelectedIndex)
[Code] .....

View 2 Replies

Returning A Multidimension Array From A Function?

Mar 15, 2010

I'm having trouble finding out how define this function so I can return the arrayRight now I am defining the returnobject as 'object' but I would like to do it properly.The Function goes something like this:

View 2 Replies

Returning New Array Dimension From Within Function

Jun 22, 2011

I'm trying to return changes to array data, including redimensioned arrays, from within a function call in code similar to:
fault = MyFunction(Array1, Array2)
Public Function MyFunction(ByVal inObj1 as UserStruture(), ByVal inObj2 and Integer(,)) as String
Dim myResult as String = "Failed"
Dim tmpStruct() as UserStructure = inObj1

[Code] .....

This works fine in updating the input array 'Array1', only when the redimensioning of tmpStruct is NOT performed. After redimensioning tmpStruct, the redimensioned array is passed back successfully into 'inObj1' within the function 'MyFunction', but is not passed out of the function call; i.e.
fault = MyFunction(Array1, Array2) -

The dimension of array 'Array1' out of the function call remains as it was before the function call. However, the data change; i.e.
tmpStruct(0).Nam = "New Name"
is passed successfully out of the function call.

Why the Redim operation is not passed back out of such function calls. I would like to return changes to arrays 'Array1' and 'Array2', plus a result string from the function call if I can. Furthermore, I would also like to change the dimension of the array within the function call, if required, and return the complete redimensioned array back out of the function call.

View 4 Replies

VS 2010 : Copy This Array To A Temp Array So That The Temp Array Has All The Same Values As The Original Custom Array?

Jun 19, 2011

I have an array of people stored in a custom structure array... how can i copy this array to a temp array so that the temp array has all the same values as the original custom array?

View 4 Replies

VS 2008 : Function Returning Variable Array?

Jan 31, 2010

I should be able to pass an array of numbers, calculate average, lowest number, highest number, and standard deviation.the function returns an array containing the results. I dim public data

Public dataArray() As Double
Public DataIndex As Integer = 4
Private Function CalculateData(ByRef dtArray() As Double) As Double()

[code]....

I get an "error Number of indices is less than the number of dimensions of the indexed array" stats()If I add a dimension there like stats(Dataindex) I get an error "Value of type '1-dimensional array of Double' cannot be converted to 1-dimensional array of double".

View 2 Replies

Returning Byte Array - Getting The Error On 'Return ImageData'?

May 11, 2011

I have the following function (in a WCF)

[code]...

Problem is, I'm getting the following error on 'Return ImageData':Value of type '1-dimensional array of Byte' cannot be converted to 'Byte'.I've been playing with it, but can't seem to figure out what I need to do to ImageData.

View 1 Replies

Export Values From Array Into Excel And Import Scatterplot Of Values?

Mar 28, 2011

I am creating a maths programs that draws graphs for the user. so far i have placed 22 values into an array and now i need to import them to excel, draw the graph and import the graph back into the program to display them.[code]...

View 4 Replies

How To Find Repeated Values In One Dimensional Array And Change The Values

Jul 14, 2009

I am using Visual Basic express edition 2008.I am trying to know if a value in a single dimensional array is repeated in the array. If yes, then multiply one of them by 100. For example:

MyArray (14) = 12, 15, 18, 15, 18, 11, 15, 18, 16, 14, 18, 8, 12, 17, 10
In the above example:
MyArray (1) = MyArray (3) = MyArray (6) = 15
MyArray (2) = MyArray (4) = MyArray (7) = MyArray (10) = 18
MyArray (0) = MyArray (12) = 12

[Code]...

View 8 Replies

Assign Different Values To Existing Values Of 2 Dimensional Array?

Apr 4, 2010

I have an array of 10 x 10 as shown below. In addition to -1, it consists of numbers from 1 to 9.[code]...

View 6 Replies

Cast Integer Values To An Array Of Enum Values?

Jan 2, 2009

cast integer values to an array of enum values?

View 2 Replies

Obtain Index From Array Where An Input Value Lies Within A Range Of Values In The Array?

Dec 12, 2010

Per this UserControl that can be added to a blank form, I would like to use the HorizUnits array below to map custom grid x coordinate from a mouse x position.For a given input value 13, what syntax would I use to obtain a value of 2 where 13 lies between Value 10 and 16 for which 2 (Name) would be the custom grid's displayed coordinate position?

View 1 Replies

Comparing Values In 2D Array To Values In 1D Array?

Jun 21, 2010

I have a program that reads in lottery results from the past 6 months (from the national lottery site) from a text file

31-Mar-2010,29,18,38,44,14,43,13,3,GUINEVERE
27-Mar-2010,32,38,11,15,42,6,24,2,GUINEVERE
24-Mar-2010,3,49,28,5,23,42,41,4,GUINEVERE

and stores it in an array (n-1,6) where n is the number of lottery lines, so the array looks like

0 1 2 3 4 5 6
0 29 18 38 44 14 43 13
1 32 38 11 15 42 6 24

then, in a 1D array I store the player's numbers, simply as

0 23
1 16
2 19

[code]....

I want it to take each number from the player's number array individually and compare them to each row individually in the lotto results array i.e. the first six cells in each row in the results array will be compared with each user number to find any matches, if a value matches then a count is incremented. if the count is greater than 2 but i'm getting no where with it :( i've been trying to use the For To loops but keep getting index out of range, or else nothing is happening at all!

View 5 Replies

Array Calculation - Unable To Calculate The Values Coming From The Array ?

Dec 7, 2010

I am writing a pizza order program for class and have gotten everything put together, even got my array setup and displaying but when i go to calculate it will not calculate the values coming from the array in any of the calculations.

[highlight="vb"]Option Strict On Public Class Form1 'declare structure and module-level variables Structure PizzaSale Dim SizaString As String Dim StyleString As Stri]

View 3 Replies







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