.net - Calling A Sub And Returning A Value?

Mar 15, 2012

This might seem like an insanely easy question, but I cant seem to find an answer anywhere to it. I'd like to think that I am decent at VB but while I was learning javascript the other day I found something that seemed awesome and now I cant figure out how to do it in VB.in javascript it looks like this

var someValue = getThatValue()Its both calling and setting the value from the getThatValue() sub. what is the VB equivalent?

[Code]...

View 2 Replies


ADVERTISEMENT

Asp.net - ODP.NET Calling A Stored Procedure And Returning A RefCursor

Mar 27, 2011

This problem has driven me mad for over a day now. I can create a connection to the database, I can execute sql and return results from that but I can't seem to call a stored Procedure. Here is the code

[Code]...

it works ok but no results are returned. I've verified that the procedure returns results for the user I'm logged in as. When the query was executing I could see a refcursor in there but it was empty. I must be going mad.

View 1 Replies

Constructor Returning Data To The Calling Form?

Jun 7, 2010

I have a MDI app that I am creating. It, of course, will have multiple MDI child forms. In each child form, I have an options button so that each child form can have it's own set of options. When I click the options button it opens an Options form. This options form is not an MDIChild.

I have a class that contains the child forms options. I pass this class to the options form using a constructor. This is how I call the options form:

Dim dlgPatternOptions As dlgOptions = New dlgOptions(thisPatternOptions)
thisPatternOptions is the class that I am passing to the Options Form.

This works fine and the options form does populate the options correctly. The Options form constructor is this:

Public Sub New(ByRef thePatternOptions As CanvasOptions)
Me.InitializeComponent()
Me.txtCanvasWidth.Text = thePatternOptions.CanvasWidth.ToString
Me.txtCanvasHeight.Text = thePatternOptions.CanvasWidth.ToString
End Sub

I change the options in the options form. How can I get those changes back to the calling form? Do I need to somehow pass a handle of the calling form to the constructor to get the changed values back to the calling form? Is there some way to pass a handle to the options form so that changes made to options will be pushed back to the calling form?

View 2 Replies

Asp.net - Returning In Oracle INSERT Is Not Returning Proper Value?

Mar 15, 2012

I have an ASP.NET web application (VB.NET) using an Oracle database. On an insert, I need to get the identity of the inserted row back. I am trying to use RETURNING, but I keep getting a value of 1 returned.

Dim strInsert As String = "INSERT INTO L.TRANSACTIONS (LOCATION_KEY, TRANS_CREATOR, TRANS_EMAIL, TRANS_PHONE) VALUES (:location_key, :trans_creator, :trans_email, :trans_phone) RETURNING TRANS_ID INTO :ukey"

[Code].....

View 2 Replies

Returning A Function Vs. Returning Variable Name?

Dec 12, 2011

My brain may just be fried since it's the end of the semester, but my teacher kicked this back to fix and resubmit...she said that I am "returning the name of your function rather than your variable name".

Here is my code for all 3 forms.

code:

These are forms to calculate the cost of getting a cell phone package.

View 6 Replies

VBA UDF Returning #VALUE

Nov 13, 2010

So I have a pretty simple UDF written in visual basic for use in excel. It calculates your approx. taxes. Lets say I use it as such: =Taxes(I23-I18,I24-I20,"Married")

If I type this in it works great. Now if I save the sheet and restart excel the cell now says #VALUE! If I select the formula and hit enter once again it recalculates it fine. What am I doing wrong? Application.Volatile shouldn't be needed but I was trying ideas. [Code]

View 1 Replies

Asp.net - DaylightSavingTime Returning Different Value?

Nov 2, 2010

I have a piece of code that checks a time and then adds hours based on the daylight savings time value.

Dim CommentDateTime as Date = "11/2/2010 8:21:42 PM"
If CommentDateTime.IsDaylightSavingTime Then
'do something
Else
'do something else
End If

The problem that I'm having is that IsDaylightSavingTime behaves differently on the production server than it does on the development.On the development server the case is TRUE, but on the production it is false.

Both servers are running the same OS and are both running .NET 3.5

[Code]...

View 2 Replies

Asp.net - GetConstructor Returning Nothing

Oct 10, 2011

I have two different GetConstructors(), one is returning what it should be returning the other however is returning nothing. ItemName is BSRPTReportPerformanceSubcontractorRating
The first one which is returning what it properly should is:

[Code]...

View 2 Replies

C# - Returning XML From A Web Service?

Mar 20, 2012

I have an XML file that sits on the hard drive of a Server running my Web Service. I need to access that file from another application.

This is my method on my Web Service

Public Function getXMLFile()
Dim xmlDocument As System.Xml.XmlDocument
xmlDocument = New System.Xml.XmlDocument()

[Code]....

This is caused when I try to return the xmlDocument object

From the information I gathered, it's like SOAP wants to wrap my XML in more XML and stops me from doing that.

How do I go about getting the XML File from my Web Service if I can't return XML?

View 1 Replies

Combobox Isn;t Returning A Value?

Nov 23, 2010

i am new to VB programming, actually this is my first time with VB any ways here is my situation that is driving me mad

[Code]...

View 7 Replies

Msgbox Returning A Value?

Jun 22, 2010

I am creating a message box in VB8 for an error. I created the message box and everything works. The message box returns a value of 0 which is the default one. Where does it return 0 to. Or do you have to tell it where to return it.

View 2 Replies

Returning A DataTable In WCF And .NET

Apr 25, 2011

Thanks William, that was the ticket. Had to assign the name property on both ends [DataTable.TableName].

On a side note here: There appears to be some school of thought (no offense Marc) that the following statement is always true:

"Everything in the world can and should be made into an object."

It is, simply, not always true. There are cases where you cannot cram your 'object' into any cookie-cutter or class no matter how you try to customize it. For me to objectize this beast, I'd have to create roughly 4,000 objects. I don't have time to do that, and yet this project must run as a service. Frankly I think the developers at MickeySoft need to get out more into the real world, and see for themselves that although theory is great it does not represent true-life challenges. I am all for working with objects for the obvious benefits, but there is a reality that universals do not exist. In my trade, even 'most of the time' rarely happens.

Before they push out a new technology set, and cease support of an old one, they need to make sure that the new technology has the same capabilities the old one had.

For the record: The people who believe the above statement to be true are also the same people who would refuse to take the project I'm currently working on.

Just the same -- thank you both for your time, efforts and opinions!

I'm trying to create a WCF function that will return a table to my console testing app. I am a total noob. The data is 2-dimensional and looks like this:

23 Letter
42 Another Letter
43 Document

[Code].....

...Of course, it won't work. I just need to get the WCF to pass a basic table to my console application. The execute SQL seems to work just fine, I just can't get the data back to my application.

View 1 Replies

Returning A Function Value

Dec 14, 2009

returning a function value? I have a simple function that returns an integer. This function works fine when executed in SQL Developer but, when called from my apps, it always returns 2 regardless of anything. I have checked it over and over again, I cant seems to find where I am going wrong.

[Code]...

View 6 Replies

Returning A Value From A Form?

Jun 15, 2010

I want to return a value (vbCancel or vbOK) from a form which is shown as a dialog from the calling form.So, I overloaded the showdialog method to return the value.Trouble is, a value of zero is returned as soon as the form is shown.Now, if I can make it behave more like the showDialog method where execution doesn't continue until the form is hidden everything would be fine.

View 3 Replies

Returning A Value From DataSet?

May 8, 2012

I have a combo box that is "linked" to dataset.

I have a Label that I want to return the value from 'Description' Column from 'Base' Table.

This is determine when user has chose a value from the combo box which is linked to the 'Base' Table from 'Material' Column.

View 1 Replies

Returning In LINQ To XML?

May 23, 2011

I am working with a method using LINQ to XML to return a string.This is the XML

<data name="lnkViewResultResource1.Text" xml:space="preserve">
<value>View results</value>
</data>

[code].....

View 3 Replies

Returning No Value From A Function?

Apr 20, 2009

what changes I need to make to the code so that when no value for intPosition is found the textbox txtRoomNumber remains blank? At the moment a value is being entered into the textbox when no value for intPosition is found.

Code:
Private Sub btnFindRoom_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFindRoom.Click
Dim strRoomType As String
Dim intRoomNumber As Integer

[code].....

View 2 Replies

Returning Plain Old XML With WCF?

Nov 15, 2011

How can this be so difficult and why? Returning simple XML with no Name Spaces and an XML decaration. Creating the XML using XML Writer is easily done and if I output it to a file then great. How on earth can you return the contents via WCF. Using an XML Element is no good as you loose the XML declaration and using a string is no good as the output is wrapped up in a <string> element. Can't return an XML Document as it can't be serialised.I know that there are many posts on this site, but none answer the question. I am using VB.NET (boy I wish I had the time to learn C#) and I cannot get the Data Contract to work either even using IXmlSerializer. An example of the output I need to send back via WCF

View 4 Replies

Returning The Max Value From Sqlite DB?

Feb 22, 2012

I have a SQLite database and I am tyring to query the max value in the RecordID field. This query works when I run it in SQLite but I can not get the VB to return the value, what have I done wrong?

Dim getMaxRecID As String = "SELECT MAX(RecordID) FROM String"
Using cmd1 As New SQLiteCommand(getMaxRecID, pConn)
cmd1.CommandType = CommandType.Text
Dim IDresults As Integer

[code]....

The connection is correctly opening the db, and shows it as open as well. No error, just IDresults returns 0 everytime.

View 1 Replies

Returning The MAX(ID) Value To Image?

Jul 2, 2011

i am uploading images to my database but saving them on the file system based on the user. But I want the name of the file to be saved to be that of my primary key column, SightId. Mt table is called Sight with columns Sightid, userid, and titleThis is want I need: The sightid value of the just added record to also be image file name. Examle, I add a record with Sightid = 3 userid=4 title=yes the image and to the file system with the upload needs to be 3.jpg. I have this code but it draws a 0:

[Code]...

View 7 Replies

SqlCeResultSet Only Returning One Row

Nov 29, 2010

I am working on a Mobile 6 Classic phone application for the first time and am having problems with the SqlCeResultSet.[code]...

View 2 Replies

VS 2008 Returning Only ONE Value?

Apr 29, 2010

Many times, I query my database for get only one value (one unique row).

I allways use this

Dim ConexaoBD As OleDbConnection
Dim DsDados As DataSet
Dim Dt As DataTable

[Code]...

I think this code in unnecessary for get only one value, and I believe thats a easy way to do it.

View 6 Replies

Why Is String Returning A Char

Jun 27, 2012

I have built a DataTable from my database. Then I am looping through the rows and trying to access a string, however the value is being returned as each character in the string.

For Each theseRows In DisplayForm.MainTab.Rows
If theseRows.Item("Last_Name") = userLast And theseRows.Item("First_Name") = userFirst Then

[Code]....

The Trap_Code values are two or three letter strings, the returned value is each letter once at a time. The loop seems to cycle through the individual characters of the string as an array rather than display the entire value, which is what I was hoping for.

View 2 Replies

.net - Function Returning Different Datatype?

Feb 15, 2011

Just come across the following snippet:

Public Function Checked() As Boolean
Return applyChange 'this is a string!
End Function

Whats going on here? How can a function with return type Boolean actually return a string? I'm assuming theres some implicit conversion going on here, which I'd rather not have.

View 1 Replies

.net - Recursive Function Not Returning?

Nov 28, 2011

I am hopeing someone can help me here with a recursive function I have that is not returning either true or false as I would have espected it to. The function loops through a Active Directory group for its members and then calls itself if it encounters any groups within the membership in order to gets its members as well. I am trying to return either true or false based on if any errors were encountered but not haveing any luck at all. It appears to just hang and never return back to the primary calling sub that starts the recursive function. Below is my code I am using:

[Code]...

View 1 Replies

Asp.net - Datediff Not Returning Expected Value?

Jun 21, 2012

this code always return '0' i don't know why

Dim cur_month = DatePart(DateInterval.Month, Now).ToString()
Dim cur_date As String = "01/" + cur_month + "/" + (DatePart(DateInterval.Year, Now).ToString)

[Code]....

cnb_mnth is ComboBox for Month

txt_year is Text Box For Entering Year

View 1 Replies

Asp.net - Returning Object From A Function?

Feb 8, 2012

If an object is created inside a function and the function returns that type of oject how is the memory handled.

Example:

Public Function GetEmployee(employeeid as integer) as employee
Dim oEmployee as new employee
oEmployee.FirstName="Bob"

[code]....

Does the variable that receive the object still a pointer to the memory location that was used inside the function?What about when you do a oEmployee2=oEmployee.Is oEmployee2 just a pointer? And any changes to oEmployee will now affect the other. Just trying to understand it from a memory perspective and how that scope works?

View 2 Replies

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

Constantly Returning A Value From A Funtion

May 12, 2009

How would one receive a value from a function while it is running?

View 2 Replies







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