How To Access Variables/arrays

Dec 14, 2011

Public Sub drawChart()
Dim panel As Graphics = picBox.CreateGraphics
Dim myTextBrush As SolidBrush = New SolidBrush(Color.Black)

[code].....

View 1 Replies


ADVERTISEMENT

Session Variables And Arrays

May 18, 2011

I loading an array with data from my data base and then putting into a session Variable. I do not get any errors on that code. When I try to put the session Variable back into an array in my .aspx page I receive the following error message: [code]

View 5 Replies

Matching 2 Variables With Arrays Or Lists To Get 3rd Value?

Nov 11, 2011

I have a pipe delimited file with 3 values on each line, something like this:
0001|234587|Bracket, 3 x 3 x 0.125, Steel
0001|254378|Bracket, 4 x 4 x 0.125, Steel
0003|234587|Hinge, 4 x 4 x 0.125, Brass

The first Value can be duplicated in the file, the second value also can be duplicated. There are no instances of BOTH values duplicated on 2 or more lines. I need to read another file and get the first 2 values, then look up those two on one line to get the proper 3rd value. The "other" file looks a bit like this:
0E0522070001EF54ED7823458700FF00FFA5A5A5A5
-----------XXXX-----------XXXXXX--------------------- (X's are the data, the rest is filler to comply with some code unknown to me)

Right now I have code to read all into an array (split on vbcrlf), then split each line on "|" and populate three arrays, I then go thru every element of the first column that matches the value I am looking for and test that the second column also matches the second value and if so, return the third array contents at the same index. This seems crude and inefficient. Cannot use a hashtable (I don't think) as it only supports 2 values. A List(Of) doesn't seem to work either and I don't want to use a database.

View 6 Replies

Passing Arrays And Variables To A Sub Procedure?

Oct 20, 2010

I am trying to complete a homework and seem to get stuck at the last point of passing arrays and avriables to a sub to do the calculations to produce the desired result of sales tax but can;t seem to accomplish that so far.

Public
Class
frmSalestax
Dim

[code]....

View 9 Replies

VB 2k5, 2k8 - Can't Get My Variables In The Program - Into Thier Arrays

May 5, 2009

I can't get my variables in the program below into thier arrays.

Dim lblnumbers(6) As Label, txtweight(6) As TextBox
Dim txtnumbers(6) As TextBox, sngnumbers(6) As Single
Dim grade() As String, g As Integer = 1, weight() As String

[CODE]...

View 17 Replies

Reload Form And Reset All Variables And Arrays

Mar 22, 2008

My program is only one form, at a certain point I want the form to reload, and have all the variables and arrays be reset? I am able to to reload the form by:

Dim frm As Form
frm = New frmMain
frm.Show()

But the original form still stays open? My program is a version of blackjack. when who won or lost is figured out i want all the cards to clear (held in an array of picture boxes) I have random numbers generated (also put into an array) each random number then finds the image of the card it belongs too and then places it into the array of picture boxes. How to reset the arrays so I thought maybe trying to just reload the form would work?

View 4 Replies

Storing Variables In Arrays On Form Submit

Nov 22, 2009

SI have a form and on submit I need the following variables stored in array.
Dim OrderName, OrderNumber, OrderSize, OrderQuantity, OrderAddOn, OrderEachPrice, OrderTotal As String
So pretty much its an order a customer will be making and every time a new order is placed, a new array will be made.

Example:
OrderName = TextBox1.Text was Sean
OrderNumber = TextBox2.Text was 123456
OrderSize = TextBox3.Text was Large
OrderQuantity = TextBox4.Text was 2
OrderAddOn = TextBox5.Text was Pocket
OrderEachPrice = TextBox6.Text was 10
OrderTotal = TextBox7.Text was 20.00

On submit a new array would be created and would be something like this:
Dim ArrayName(,) As String = {{"Sean", "123456", "Large", "2", "Pocket", "10", "20.00"}}
BUT a new array has to be created each time the submit is clicked.

View 6 Replies

VS 2008 WithEvents - Variables Cannot Be Typed As Arrays

Jun 24, 2009

I am trying to do the following:
Public WithEvents frmButtons(999) As Button

And then use it like this:
Private Sub frmButtons_Click(ByVal sender As Object, ByVal index As Long) Handles frmButtons.Click

Where the index variable has to represent the object in the array like this:
frmButtons(index).Text="..."
But it gives me an error:
'WithEvents' variables cannot be typed as arrays.

View 4 Replies

ASP/VB Byte Arrays, Iframes, Parents, Children And Variables?

Jun 21, 2011

I have an aspx page which houses an iframe. When a button is clicked, a WCF is called to produce a PDF which is read into a byte array. I was storing the byte array in a Globals.vb file like this:

Public Shared PDF_Data as Byte()

The global was loaded from the parent aspx page like this:

PDF_Data = MyWCF.Create_PDF_File(SomeVariable)

After that, the iFrame's src was set to a blank aspx page, which had the following code in the page_load event:

'Write the PDF binary data to the screen (viewer)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/pdf"
Response.BinaryWrite(Globals.PDF_Data.ToArray)

However, realizing that this application will have several users who will get different PDF documents, I have learned that this is not the way to go. My shared variable would be accessible to all users, a big no-no.However, I am stumped as to how I'm going to store the byte array and make it available to a child aspx page from it's parent.

View 1 Replies

Saving Multiple Arrays And Variables To Encrypted File?

Mar 29, 2011

I'm looking to be able to save and load the content from multiple structured arrays and variables into/from an encrypted file, is there any reliable source of information or tutorial that I'd be able to use for this? I've never written a program in visual basic that writes to/reads from a file.

I'm using microsoft visual studio 2008.

View 4 Replies

Access A Database (SQL) And Have Access To The Data Set As Variables?

Sep 18, 2009

I need a good book for beginning to use VB 2008. I have some (limited) experience in using VBA. I want to access a database (SQL) and have access to the data set as variables?

View 6 Replies

Access Arrays Via For Next Loop?

May 20, 2009

I have 5 arrays, named array1 array2 array3 array4 array5. They are integer arrays each with 5 elements in them. I want to access all the elements in all the arrays using a for next loop,the pseudo code goes something like this:

for i = 1 to 5 'this loop calls each array
for j = 0 to 4 ' this loop calls each element
if array (i,j) then

[Code]....

View 3 Replies

Access Arrays From Many Child Forms?

Oct 26, 2010

I want to access my arrays from many child forms. Where should my arrays and declarations be? and what is the code to access them?

View 12 Replies

Arrays - Access Collection Keys During For Each?

Aug 11, 2009

I have some code like this:

Dim col As Collection = New Collection
col.Add(value1, "key1")
col.Add(value2, "key2")
' later...
For Each item As String In col
' want to get valueX and keyX here; currently, "item" holds the value
Next

How can I get both the value and key within the loop? Maybe there is another class that makes this easier?

View 1 Replies

Declare And Access Arrays In Visual Basic?

Oct 5, 2011

I declared an array of strings and initialized every element to "5". But when I debug with a breakpoint after the For-Each, all my array members have Nothing in them. I'm on Visual Studio 2010.

Dim words(999) As String
For Each word As String In words
word = "5"
Next

View 2 Replies

Make A Bunch Of 2d Arrays To Access The Independant Values Easily?

Jun 18, 2009

I need to make basically a bunch of 2d arrays, that I can access the independant values easily. Like multiple properties As an example:

[code]...

Because later I have to access Value1 in a manner that spells out each independantly. I have used some basic Structures to define 1 property and does something with it. But not 2 properties, and I am out of my norm on creating a Class to do something like this.

View 14 Replies

Access Variables From Outside Of A Loop

Sep 15, 2010

I'm trying to use variables created within a loop, but I'm not sure how to do this. I've searched around on the net and there is a few recommendations to try and put what I require into a function then just call the function.

[Code]...

View 2 Replies

Can Access Variables That Don't Exist Yet

Feb 1, 2012

Basically I just want to use

tile1.backcolor = colors.while (just an example)

however tile1 is only created WHEN the form loads, and it will not let me compile it becuase it's saying it doesn't exist

View 8 Replies

Access Shared Variables Of A Class?

Jul 23, 2009

I am making a small application in which i have added a class module and a window forms in vb.net. i want to acess the shared variables and mathods of class without making any object.

View 8 Replies

Access Variables Inside Sub1?

May 25, 2010

i Have two subs

Protected Sub Btn_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Id as string = MyClass.getID
Private Sub Sub2(ByVal doc As Document)

' in here i need to access the ID from the above sub the Id needs to be in the btn_click sub cos it reates a unike id every time it is clicked.I am trying to capture the id at the time the button is clicked and store it on a variable.

View 3 Replies

Cant Access Public Variables From Another Form?

Aug 25, 2010

I have a string on my main form called String1. When I open another form, I need access to this value. In the form I open, I have always done something like:Dim NewString as String = Main.String1

This has worked in the past. Well, I ended up renaming my forms (from Form1 to Main) in the property window and it now when I type the above code, it does not list Main as a form. Nothing that I renamed seems to exist now.

View 2 Replies

How To Access Variables From URLs That Come From Get Method

Mar 14, 2009

Asp.net has turned out to be alot easier to use than PHP (so far). However, I have been searching for a while and simply cannot figure this out. How do I get the variables that are contained in the url of my page (that originate from a form that had the method "GET") and utilize them? For example, my page would be [URL]. How would I get the value of some variable?

View 5 Replies

How To Access Variables In Another Class Without Deleting Any

Oct 31, 2011

I have been charged with porting a VB6 project into VB.NET. In vb6, if you were in a class separate to a particular variable, you could access that variable easily:

Public Class Foo
Public k As Integer
End Class
Public Class Bar
k = 12
End Class

In VB.NET, my understanding is that before you can use a variable in another class, you must declare a new instance of it:
Dim foobar As New Foo
This would be fine, but I have to access these variables from different classes and every time I declare a new instance, it wipes all old values from the variables, which I need. I tried using Inherits statements but they presented many problems.

View 2 Replies

Use The Number In One Variable To Access A Set Of Different Variables?

Aug 10, 2009

I have a variable called VarNUM which stores a number from 1 to 10. What i want to do with this is based on the current number stored in that variable call a different set of variables from a module with Public Structure ITEM1. It has the same set of variables for ITEM1 - ITEM10 but with different values. So ya in raps how can i use the number in one variable to access a set of different variables? Something like ITEM(VarNUM) then the set of variables that all have same name but with different values so that i dont have to go,

Code:
if VarNUM = "1" then
name = ITEM1.name
store = ITEM1.store

[code]....

View 10 Replies

Assigning Access Fields To Variables Or Textbox?

Jun 20, 2011

I'm facing a problem with my current member card reader development.

I'm reading the card number (just a serial number of 4 digits) with a card reader. this seems to work fine (even converting the text string to integers).

This number is then put in a query to find the exact record that corresponds with this number

Me.JSM_LedenTableAdapter.GetDataByKaartnummer(IntCardNr)

View 4 Replies

Querying/Displaying Boolean Variables From MS Access?

Jan 14, 2011

I am querying the MS Access Database to display the results in a datagridview. This is my

Dim ConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=data.mdb"
Dim SQLString As String = "SELECT * FROM Groups where Selected = Yes"
Dim OleDBConn1 As System.Data.OleDb.OleDbConnection = New System.Data.OleDb.OleDbConnection(ConnString)

[code]....

The variable Selected from the query statement ("SELECT * FROM Groups where Selected = Yes") is a Boolean in the MS Access Database. However, this statement returns empty result even though most of the values for Selected are Yes. In the access database however, if I enter a 'Yes' for the value of Selected, it shows up as -1 and 'No' shows up as 0. So I even tried changing the query statement to ("SELECT * FROM Groups where Selected = -1") and also ("SELECT * FROM Groups where Selected = 'Yes'") but none of them work. Can you please help me fixing this query because I can't change the database?Also if I change the query statement to ("SELECT * FROM Groups"), then all the data shows in the datagridview, however, the values for Selected column do not display. Instead I see check boxes and I can't click them. How can I display the values correctly?

View 8 Replies

String Variables From Random Access File

Nov 17, 2010

I'm tasked with the job of creating a javascript version of a units conversion application written in vb6. I have the source code but I don't have vb 6. The source code uses a dat file to hold a conversion array (unit type, unit, xfactor, plusfactor). Getting the data out of this file would be good to me. I tried creating a little app in vb 2010 to write the data from that dat file to a txt file using essentially the same code as the source code. And that has been somewhat successful (took a while to figure out the fixed string business). Now I can pull the data out as an array. The math elements of this array look fine but the strings are somewhat read-able but too garbled to use. I can't seem to fix that by changing the character set/encoding.

View 3 Replies

InfoPath VBScript Access Function Public Variables?

Apr 15, 2009

I have the following code:

Public Function StoreFields()
Dim Lockbox, Cash_Deposit_Date, Batch_Number
Lockbox = Xdocument.DOM.selectSingleNode("dfs:myFields/dfs:dataFields/d:tbl_GC100/@Lockbox").Text

[code].....

I have tested the variables in the Functions and the are correct.

View 2 Replies

VS 2010 Storing Variables - Access And Use On Several Windows Forms

Apr 5, 2011

I've got a dictionary<string,string> that I need to access and use on several windows forms. In asp.net, I could store it in Session and use it from any aspx page. How would I do this in forms?

[Code]...

View 3 Replies

How Variables Declared With Protected Access In A Base Class Are Used To Implement Inheritance

Jul 29, 2010

how variables declared with protected access in a base class are used to implement inheritance.

View 1 Replies







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