IDE :: Checking Shared Variable Values During Debugging?

Feb 20, 2009

I have declared a class in VB.NET using VS2K5 with some shared variables and made that class a dllI made use of that dll in another project and tried to make use of those variables. Even though I can able to make use of them, Im unable to view the values of those variables like the values of normal variables when Im debugging. Is there any way that I can watch the values of those shared variables during debugging.

View 1 Replies


ADVERTISEMENT

Checking Multiple Items In A Check List Box By Variable Values?

Oct 31, 2011

I've never really used the Check List Box in the past, however, for the recent program I am developing, I am using this control rather than individual check boxes scattered across the form.Anyway, I want to be able to program through code which items get checked in this checked list box. Specifically, I have a variable that contains the text of each check box that I want checked.With a normal check box, I can simply say:

Dim strNames As String
strNames = "John Doe, Mark Johnson, Mike Brown, Cindy Smith"
If strNames.ToString.Contains("Mike Brown") Then[code]....

View 18 Replies

Asp.net - Public Shared Variable Shared Between Users?

Mar 30, 2012

I've taken over the maintenance of the website (ASP.NET VB) and on one particular page I noticed the below code

Inherits System.Web.UI.Page
Public Shared UserNumber As String
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

[Code]....

My question is whether the variable UserNumber can be accessed or changed by any other user than the current one?

View 2 Replies

Create A "shared" Variable That Is Shared With All Instances Of A Class?

Jan 14, 2011

I seem to be drawing a blank. I'd like to create a "shared" variable that is shared with all instances of a class but not classes that inherit from it. For example.Class A: Shared list As New List(Of String): list.Add("A")

Class B Inherits A: list.Add("B")Class C Inherits B: list.Add("C")The end result I'd like is that any instance of A has just A in the list. Any instance of B has A and B in the list. Any instance of C has A, B, and C in the list. I can accomplish it by creating Instance variables, but I have to construct the list for each instance of a class. I'd like to construct it once for a specific point in the Hierarchy and then share it accross other instances of that class.

View 12 Replies

Use Of Shared Variable In .net?

Mar 5, 2009

What is the use of shared variable in vb.net?

View 3 Replies

IDE :: Hovering Over Variable Name When Debugging Does Not Trigger A Popup Showing The Current Value?

Nov 17, 2009

When debugging in the old VS 2008 with the program stopped at a breakpoint, I could hover over a variable, say a string, and the value of that string would appear in a little box by the mouse pointer. In visual studio 2010 beta 2 this doesn't appear to happen.Is it a feature that needs 'turning on' somehow?I've tried debugging in 64 bit mode and x86 mode, neither works.

View 2 Replies

C# - Shared / Static Variable Should Be Nothing?

Jan 6, 2011

I have the following code:
Public Class TestClass
Public Sub Main()
If theGlobal IsNot Nothing Then Throw New Exception("What gives!")
End Sub
Private Shared theGlobal As Object = Nothing
[Code] .....
Why is theGlobal object NOT Nothing?

View 2 Replies

How To Dispose Shared Variable

Apr 12, 2011

How to dispose the shared variable in vb.net.i am using shared object of Asterisk.NET Manager Variable, i assigned it in form load and i dispose it in main form closing, My problem is after closing the application, application.exe keeps live in task manager, if i not initializing the shared object in form load there is no problem,[code]

View 3 Replies

Public Shared Variable Ref?

Jun 29, 2011

I have an arraylist in a user form (Mainform) that I would like to be able to share among multiple forms and edit the contents. Using the Public Shared method I have been able to view and even edit the arraylist, but it does not seem to be changing it back on the main form. I can give more detail if needed.

View 9 Replies

.net - ASP.NET Shared Variable For An Error Handler

May 28, 2012

I am planning to use a shared variable to implement a logging facility. Have a look at the code below:

Imports System.IO
Public Class TestClass
Public Shared objError As New StreamWriter("C:Test.txt")
End Class

[Code]....

I think I have found my answer here: [URL] "A static variable continues to exist and retains its most recent value. The next time your code calls the procedure, the variable is not reinitialized, and it still holds the latest value that you assigned to it. A static variable continues to exist for the lifetime of the class or module that it is defined in."

I am not convinced that this is the best way to create a logging facility.

View 2 Replies

C# - Does Session Variable Shared Across Different Browser

May 24, 2012

Does session variable shared accross different browser? If not is there away that I can share information accross browser similar to the functionality of caching but the scope is wider.

View 3 Replies

How Many Instance Will A Shared Variable Be Created

Apr 7, 2010

How many instances of a shared variable will be created in a class? just one? correct

[code]...

So, in other words, the DocumentDelivery class will only have one instance of RenderList, correct? can somebody confirm?

View 3 Replies

Shared Variable For Multiple Loading

Jul 22, 2011

I need some tips for shared variable to share the information for multiple running application. For example, the value of variable become 1 when a user run the first instance(execution), and become 2 when the user executes the second(in sames OS or through network).

View 3 Replies

VB 2008 & Debugging Simple Code Runs With Variable Assignments Left In Memory?

Sep 16, 2011

I'm running VB2008 on Windows 7; I've written out a ver simple piece of code:

Option
Explicit
On
Module

[code]....

When I run or debug the code, it asks for the First Number and then just completes the running of the program without asking for the second number and uses some random number. The console.readline() doesn't work either, the console window just disappears.

View 2 Replies

Accessing A Public Shared Variable From A Different Class?

Jan 10, 2012

I currently have two forms, and I need to share the value of a variable in one of them.

I declared the variable to be 'Public Shared', and assigned a value to it. However,

when I inspect the value it appears as 'Nothing'. Here is the snippet:

Public Class A
Public Shared sVar As String = Nothing
Private Sub A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

[Code]....

View 4 Replies

Create A Shared Project Wide Variable

Aug 3, 2010

I've been looking at using PROPERTIES [URL] but frankly I don't understand it that well. Before I invest the time to read, understand, and truly comprehend this, I want to make sure it's the best way. My intended goal is to create my database connection string in a function/sub somewhere, then assign it to this project wide string variable, then I can use it in any form, project wide without having to recreate it.

[Code]...

View 7 Replies

Declare A Variable To Be Shared By 2 Forms (classes) In The Same Project?

Jan 1, 2011

I've gone brain dead and can't remember how (where) to declare a variable to be shared by 2 forms (classes) in the same project.

View 2 Replies

C# - Access A Shared/static Member Through An Instance Variable?

Mar 3, 2011

Here's an example of what I'm talking about...

Public Class Sample1

Public Shared Function MyValue() As Integer
Return 0
End Function
Public Sub Code()

[Code]...

Me.MyValue gives a warning in VB.NET and (the equivalent code gives) an error in C#. Is there a particular reason for this? I find it more intuitive/natural to access the shared function using 'Me.MyValue' - but I avoid it to keep my warnings at 0. Did someone else just decide 'Nah, it makes more sense to do it the other way' or is there some technical reason I don't understand?

EDIT: I was thinking of it wrong, more like a 'sub class' in OOP. Even if something is declared in the base class, you access it through the instance you have. But that relationship is not the same with shared or static.

View 6 Replies

Release Public Shared Variable After Form Close?

Mar 4, 2010

shared variables of particular form in vb.net 2005

View 1 Replies

VS 2008 - Checking If Date Variable Is Not Set

Feb 28, 2010

In the following code, a Date variable is declared but not set to anything:
Dim myDate As Date
What's the proper method of checking if the Date variable is "new" and not set to anything?

For example, getting the lowest date value from an array of dates:
Dim dtMostRecent As Date
For i As Intger = 0 To myDateArray.Count - 1
If myDateArray(i) < dtMostRecent Then dtMostRecent = myDateArray(i)
Next

In the code above, I need a way to check first if dtMostRecent is unassigned, in which case just give it the first value, after which it can be compared with subsequent values. How to check if a Date variable is unassigned.

View 5 Replies

Access A Class Variable Inside Shared Method (JSON)

Jun 20, 2012

Inside my .aspx I have some JSON code that looks like this:

[Code]....

Basically what I'm doing is pulling text from two labels on one page, and sending them to another page by calling the "doIt" function which looks like this:

[Code]....

Just so I'm clear, the "doIt" function and the JSON call are on two separate web forms. My problem is that with the "doIt" function being Shared, I can't access any global variables of the class. And if I remove the Shared, my JSON doesn't execute.

View 1 Replies

Error: Reference To A Non-shared Member | Constructor; Pass Variable

Mar 13, 2010

I've been trying implement Constructor method in passing variable between two forms.Just a rough user interface guide - issue Invoice. User would type in all the Customer Name, Document Number. Once he reached Item Details, a Child Form would pop-up for the User to select/search the Invoice's Item; Once selected, the selected item would showed in the primary Form.

What I had tried is, the Constructor method worked perfectly when it is self-contain in a new project, yet to be implement in my application.But when I implemented, there is an error: Reference to a non-shared member requires an object reference.

[Code]...

View 6 Replies

Local Variables In Shared Method Work Like Static Variable In C?

Aug 23, 2011

Will the list in this shared method keep its state throughout the life of the method? Or will a new list be created every time this method is called?

[Code]...

View 3 Replies

Checking 2 Textboxes Values?

Jun 4, 2011

Iam trying to Check Values Of 2 textboxex .. n then Print A certain Amount.

[Code]...

View 2 Replies

Checking Two Values Are Equivalent?

Jun 23, 2010

I'm trying to make a small program that helps cashiers to practice typing barcode on their machine. Barcode consists 12 numbers, and it can start with 0. Below are the code I worked on so far.

[Code]...

View 3 Replies

Checking Values Within A Range

Oct 18, 2011

I have 14 values, that change constantly. I need to know how to check each value against each other to see if they are within 250 of each other. [code] I want these two values in the listbox to blink red in the list box. but i always want each value to check every value in the list box. i dont even know where to start short of programming each possibilty with a if than statement and that would take forever

View 1 Replies

.net - Checking For Null Variable In Workflow 4.0 Transition Condition

Feb 27, 2012

I'm implementing a State Machine in WF 4.0. In some transitions, I have added a condition where I check that some variables have the expected values. The variables are enums and booleans, and everything is fine.

However, now I tried to evaluate when a property is null. I have and argument in my workflow, let's say, 'MyArgument'. In a transition, I try to put a condition like 'MyArgument.MyProperty = Nothing'. I never developed in VB.NET, I don't know if I'm missing something here...

VS2010 gives the following error: "Error 4 Compiler error(s) encountered processing expression "MyArg.MyProp = Nothing".
Operator '=' is not defined for types 'XXXX' and 'XXXX'

The type names are exactly the same, and I have debugged VS2010 to ensure that my assembly is not loaded from 2 different locations.

How can I check if the property is null or not?

BTW, I'm using VS2010 SP 1, with .NET Platform Update 1 installed, on W7 64 bits.

View 1 Replies

Reflection - .NET: Checking If Variable Is Of Guid (nullable) Type?

Jan 16, 2012

I'm trying to check if a variable has been defined as a nullable Guid. eg.

Dim myGuid As Nullable(Of Guid) or Dim myGuid As Guid?

It seems doing a myGuid.GetType returns the underlying type, that is type Guid, not Guid?. So testing myGuid.GetType Is GetType(Guid?) always returns False.How do I find out if myGuid is a nullable type?

Ed: I can do the following, which correctly returns True for "Guid?" and False for "Guid":

Not Nullable.GetUnderlyingType(GetType(Guid?)) Is Nothing

The problem is that I don't know how to retrieve the nullable type from the variable itself, in order to test it. I've only been able to get the underlying (non-nullable) system type.

I've written a db helper function. I pass it an object comprised of public members, representing the row data of a table. The members are the table columns.Using reflection, I loop through these public members to create an INSERT statement for a command object and populate its parameters with the values in those members. So far so good.But now there's a table which has a uniqueidentifier column which I must not populate from the row object, as it defaults to "NEWID()" (using SQL Server 2008). Instead of skipping all Guid columns, which would be easy, I only want to skip ones defined in the row data class as "Guid" (non-nullable).Basically, I'm using the Guid? (Nullable) type to indicate it's ok to populate that uniqueidentifier column with data. If it's non-nullable, that tells me to skip it because the column has a NEWID() default value.

View 3 Replies

Checking Combobox Values In Datagridview?

Nov 4, 2008

I want to check if two combobox values are equal. The comboboxes are in a datagridview.I found you need to use datagridview_EditingControlShowing to add a handler to the comobo boxes for selectedindexchanged. I can do this with this code.

Code:
Private Sub dgridRegisters_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles dgridRegisters.EditingControlShowing
Dim combo As ComboBox = CType(e.Control, ComboBox)

[code]....

However, the message box comes up for every combobox in my datagrid when I change the index, not just the cmbPort2. I would like to have something like this...

If cmbPort1.selectedindex == cmbport2.selectedindex then
'do something
endif

..but it doesn't seem possible.

View 1 Replies

Checking For Changing Values Timing?

Jan 14, 2010

Im trying to check to see if a value of a label changes over time. however I can't seem to get it right.

dim val1 as string
dim val2 as string
private sub form1_load()
dim val1 = label1.text
end sub

[Code]...

problem is it will only check it once after ten seconds when the timer is set to 10 seconds i need to to check it every 10 seconds becuase these values display altitude, and if the server freezes the altitudes dont change. I need to make sure they are updated and not frozen.

View 3 Replies







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