Assign External Value In Variables?

Jul 11, 2009

i remember that in Qbasic i could assign values to variables from a text file. (not in the code inside.). How to make the same in VB.NET?

View 5 Replies


ADVERTISEMENT

Assign Variables From Split?

Jun 28, 2009

I have this string, it's "x/y". How can I use the split function to rid the / and assign the x to myVariable and assign the y to myVariable2

View 1 Replies

Assign A Value To The Variables In The Class File?

Jan 28, 2009

I have a class file, myClass.vb. Here is an example of the file:

Private _active As Integer
Private _categoryID As Integer
Property active() As Integer

[code]....

when I want to assign a value to the variables in the class file, should I assign them like what I have in line 24, and 25 or line 28 amd 29? how I assign the variables in terms of performance?

View 2 Replies

Assign Variables Dynamically In A Loop?

Jun 20, 2009

I need to assign variables dynamically in a loop. In php you would use curly brackets but this doesn't work in vb.

Dim i As Integer
For i = 1 To 12
lblMonth{i}.text = 'whatever
Next

Anyone know how I can escape the the i variable so it becomes part of the string that precededs it?

View 7 Replies

Database And Split And Assign Them Into Variables?

Feb 23, 2010

How do I read a line in a database and split and assign them into variables?As of now, i can only load the entire database into a variable

sql = "Select * from MenuDatabase" How do i read the database line by line and spit the lines according to column?

View 1 Replies

VS 2010 Assign Same Value To Multiple Variables?

Nov 19, 2010

What is the cleanest way to assign a value to multiple variables? For example, how can I assign FALSE to each of Label1.Visible, Label2.Visible, Label3.Visible, Label4.Visible, and Label5.Visible.Is there anything like

code
Label1, Label2, _
Label3, Label4, _

[code]....

View 1 Replies

Assign Selected WPF Datagrid Row Columns To Variables?

Apr 18, 2010

I have a datagrid with customer data such as ID, name, email, phone etc.When I select a row (with a button or selectionchanged) I want to store that row's columns in variables like

dim email as string
dim name as string
email = dgCustomers.theselectedrow.theselectedcell

[code].....

View 1 Replies

Assign The Results Of An SQL Query To Multiple Variables In .NET?

Mar 30, 2012

This is my first attempt at writing a program that accesses a database from scratch, rather than simply modifying my company's existing programs. It's also my first time using VB.Net 2010, as our other programs are written in VB6 and VB.NET 2003. We're using SQL Server 2000 but should be upgrading to 2008 soon, if that's relevant.I can successfully connect to the database and pull data via query and assign, for instance, the results to a combobox, such as here:

[Code]...

How do I execute a query so as to assign each field of the returned row to individual variables?

View 2 Replies

Storing Application Variables In An External File?

Jul 8, 2009

I have been tasked to create an application, for which the requirements may change over time.This application will be a data entry Windows application,of which multiple copies will be running.All data will be written to text (.CSV) files for validation before being uploaded to a remote mainframe system (iSeries).My application needs to store certain variable information in an external text (or XML) file; for example, the file path to shared resources (which may change over time),as well as the specific data fields required by the mainframe system.

My questionsare these: what is considered the best practice for accomplishing such a task, and how would I accomplish it?I am completely new to XML, so I don't even know where to begin, although I am sure that XML is the path to follow for what I am trying to accomplish.

View 1 Replies

Assign The Authority And Get A New Form To The New Assign With .net?

Mar 9, 2010

Admin assigns the authority and get a new form to the new assign in with vb.net & access. I am not sure about this,I need a way to do the new form assigned? How?Actually, this project is the admin will assign the authority to a manager, and the manager will get the password to log in. Then, the manager once log in and will get a form to set the rooms who is going to use and date, etc, this is multi-manager to handle the room setting jobs.But, I think, I got stuck, I am not sure how to do the new form, HOW DO YOU ASSIGN THIS NEW FORM FOR EACH NEW MANAGER?????? THIS IS VB.NET WITH ACCESS.

View 3 Replies

Zip A Folder Without Any External Dll Nor Any External References?

Feb 3, 2012

I wanted to know if it is possible to Zip a folder without any external dll nor any external references - just with native features.I've been able to Zip files with System.IO.Packaging, but it does not include folders and I cannot tell it to Zip the parent folder.I know there are external dll and so, but I'd like to know if it's possible to make it from a native way.

View 1 Replies

VS 2008 - Take A String Of Variables With A Common Delimiter And Break It All Back Out Into Separate Variables

Dec 11, 2011

Last year (2010) I came across a FANTASTIC command that allowed me to take a string of variables with a common delimiter and break it all back out into separate variables (possibly an array) with one statement.

[Code]...

As long as the delimiter was a unique specifiable character, this one-statement command could break it out into elements. my memory and point me in the right direction.

View 2 Replies

Passing Multiple Byref Variables / Variables Fail To Change Calling Funct W/ Invoke

Sep 27, 2010

I have code, shown below, that works all except for 1 thing: The variables being passed byRef get passed, but once modified in the else section of the "if me.invokerequired" code of RecordData, the variables are never updated in the calling function. To reiterate, the calling function does not receive the updated data that is in the variables custid and amt.When debugging, I see the data change in the else section of "if me.invokerequired", but once it returns from the callback the data is missing.[code]

View 15 Replies

Define Some Global Variables Of A Class - Variables Occupy Memory?

Mar 23, 2012

I define some global variables of a class as follows:

Private Class MyClass
Private var1 as Decimal
Private list1 as List(Of string)[code].....

But I found that after this form is closed, all above variables, var1, list1, list2 still exist in memory. I thought they should be collected by gc since the form is already disposed as I confirmed.

Add: I have monitored half an hour after the form is closed. But these variables are not collected by gc. I have an automatic update procedure on the form which uses above variables.Since the above variables still hold values, the automatic update procedure is always called which causes exception. (One quick fix is to check if form.isDisposed in update procedure. But I do not think this is elegeant. Besides, these variables occupy memory.)

View 2 Replies

Memory Used In Declaring Variables Are Reclaimed By The OS When These Variables Go Out Of Scope?

Jan 7, 2010

Does the memory used in declaring variables are reclaimed by the OS when these variables go out of scope?Does the memory used be released by setting thier value to nothing? if not, then how can I force the garbage collector to run or excecute at a certain/desired time..How about in Windows Forms..How can we make sure that the memory used in initializing and showing forms be released if those forms were closed?

View 13 Replies

Multithreading: Reading/setting Variables, And Passing Variables?

Mar 8, 2011

Question 1: What is the difference between "Background Worker" and "Worker Pool" as indicated within the MSDN samples provided.

Question 2: I noticed while using, AddressOf _Function_, variables cannot be passed; what would be an efficient solution to this?

Question 3: While using multithreading is it required to invoke before setting variables, or only form properties?

Question 4: While using System.Net.Sockets is it safe/efficient to use Application.DoEvents while waiting for new data; or would be using a Do While loop be fine without DoEvents since the action would be multithreaded? Note: there can be up to 2000-3000 sockets in use at a time.

View 10 Replies

Use Variables Or Properties, And Global Or Static Variables In A Class?

Jun 9, 2012

I'm new in .NET programming.I have a class Form1 that includes Button1_Click event.Button1_Click creates a multiple Text Boxies at run time)Here is the class:

Public Class Form1
Dim shiftDown As Integer
Dim counter As Integer

[code].....

View 3 Replies

.net - Assign Value To String?

Apr 29, 2012

Consider following code:

Dim S1 As String = "a"
'this is the string in a file
Dim StringFromFile As String = "S1=hello"

[code]....

how to assign value to S1?I have declared a string named S1. Now I want to assign new value to S1. The new string value is stored in a file using following format: [variable name][= as separator][string value]. How do I assign the value to S1 after retrieving the string variable name and value that stored in a file?

NOTE:

temp(0) = "S1"
temp(1) = "hello"

It should be noted that the string with the data comes from a file that may change from time to time! When the file changes, I want the variables to change as well.

Further clarification I need a piece of code that when processing a string like this "S1=hello", the code will first find a declared variable (i.e. S1), and then assign the S1 variable with "hello" string. The "=" just acted as separator for variable name and variable value.

UPDATE:

My attempt to use Mathias Lykkegaard Lorenzen's EDIT 2 example but failed with "NullReferenceException" on this line "Field.SetValue(Me, VariableValue)". Please help me fix the problem. Following is my code based on Mathias Lykkegaard Lorenzen's EDIT 2 example:

Public Sub Ask()
Try
Dim S1 As String = "a"
Dim StringFromFile As String = "S1=hello"

[code]....

View 7 Replies

Assign Each Value To Its Own Variable?

Apr 27, 2011

I have a file txt file that holds 3 values each seperated by a space how can i assign each value to its own variable and use that for other things?

View 4 Replies

Assign Hot Key For Textbox?

Jun 2, 2011

assign hot key for textbox?

View 13 Replies

Assign Hot Key In VB 2010?

Jan 9, 2012

how to assign Hot Key? like F2, F3 and F5 from form?i am created two forms. if press F5 key. then goto to the Second form?

View 3 Replies

Assign Same Value To An Array?

Aug 24, 2010

Does Visual Basic arrays have the possibility to assign values in one line?i.e. No need to have a loop to assign a value for the whole array.for example,

Dim Array1 (1000) As Integer = 478
Dim Array2 (1000, 1000) As Integer = 852

this means that all values of array1 will be 478 and the other is 852.

View 6 Replies

.net - ASP.net - One Label - Assign Different Values

Jun 22, 2011

I have a label, lblmessage, which I want to assign 4 different values. It should show up like this:

[Code]...

I know this: lblmessage.text = "5" and to assign it another value lblmessage.text = lblmessage.text + "4". This just puts them next to each other, but how can I get them to show up underneath each other?

View 2 Replies

.Net Assign Values To Datatable?

May 22, 2012

I have the String and integers to which some values are assigned. now i need to read the string and integer values and assigned them to the datatable which i have created using VB.Net.

[Code]...

View 1 Replies

Asp.net - Assign A Gridview Value To A Label?

May 2, 2011

How can i assign a value in the Gridview to a label?

Dim Command3 As New SqlCommand
Adapter = New SqlDataAdapter("Select [Parking_Cost] FROM Parking Where [Parking_ID] = @Parking_ID2", myConn)
Adapter.SelectCommand.Parameters.AddWithValue("@Parking_ID2", Parking_ID2)
Adapter.Fill(Dataset)

[code]....

Tried binding did not work

View 1 Replies

Assign A Different Color To Datagrid Row?

Aug 10, 2007

I have developed an applcation using vb.net, its a windows based or Desktop Application. In one of the Form i am displaying the new complaints in a DataGrid With Employee Names.

Now, Each employee has a prority set for him, so depending upon the priority I want to assign a different color to Datagrid row.

View 8 Replies

Assign A Dynamic Fontstyle?

Sep 22, 2009

How do I assign a dynamic fontstyle? I tried this but all I get is normal and not an italic or normal fontstyle depending on the columns value.

[Code]....

View 6 Replies

Assign A Key Press To An Event?

Jun 30, 2010

I want to build in the functionality so that when eg, the Key "1" is pressed it can trigger an event like eg. set the counter to zero.

I have used the following code to test the function but it doesn't seem to work. I don't know if I have placed it in the correct area or it is doing what I want it to do as there is no message box that appears.[code]...

View 2 Replies

Assign A Public Property?

Feb 22, 2011

At the moment i'm working hard to better understand aspnet (VB), still learning and still enjoying, but at the moment i'm struggling with (i think something realy easy) but can't find out how to fix it,what i need to do is: assign the propperty Weekday() of CSlot Dim CSlot As New timeslotParamTO I have to assign te propperty weekday to Cslot but the propperty must be 1 or more items from the Public Enum WeekdayEnum. i just can't figure out how to assign 1 or more weekday's to CSlot.weekday().

[code]...

View 2 Replies

Assign A Resource According To A Variable?

Apr 2, 2010

I've been making this BlackJack program for a school project

I have 52 image files, labelled from '_1' to '_52' in my resources folder, each number corresponds to a card.

My question is, how do I get a picture box to assign the correct resource according to a variable

So, say I have

"pictDealerCard1" -> picture box which displays the first of the dealers card
DealerCard1 = 37 -> random number generated through INT(RND() * 52)
and resource '_37'

[Code].....

View 3 Replies







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