Variable Text Box Values?
Apr 19, 2011The code below reads an xml file and for each row will populate a particular group of
View 4 RepliesThe code below reads an xml file and for each row will populate a particular group of
View 4 Repliesi have this error in the line of with xl.active......Object variable or With block variable not set.
Dim xl As Object
xl = CreateObject("Excel.Application")
With xl.ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:Documents and SettingsUserDesktop429MEDICA2.TXT", _ Destination:=xl.Range("$A$1"))
[code]....
If I have a private sub and I call a function from within that sub, will the variable values in the sub be available to the function?
View 4 RepliesI want to check If a variable is equal to some values or not, for example:
if a = 1 or a = 5 or a = 7 or a = 10
is it possible to do it like sql:
if a in (1,5,7,10)
I have created an array of 6 numbers which are randomly generated, I can create a graph using six randomly generated numbers, however what I want is to use the random values that are placed in the array to create my graph, I have enclosed the code that I have:
Private Sub btnGraph_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGraph.Click
txtAns.Text = ""
[Code]......
I've populated my list variable from my dataset. How do I display the values of the list variable in a message box? Dim strList As New List(Of String)
View 9 RepliesLet's say I have 50 cars and I created 6 attributes for each of the 50 cars (therefore 300 total variables and values for those 300 variables). These attributes are created and valued based upon the following structure:
Car1Name = "Dark Red Car"
Car1Color = "Dark Red"
Car1DoorCount = 4
Car1Cost = 10000
Car1Appeal = 10
Car1BoughtStatus = False
Car2Name = "Bright Red Car"
Car2Color = "Bright Red"
Car2DoorCount = 4
Car2Cost = 11000
Car2Appeal = 8
Car2BoughtStatus = True
and 48 others of similar structure/syntax
How do I take a a module with these variables and values and populate them into a listview within a form such as Form1 and ListView1 without continuously going into listview's UI and manually entering the data? The goal is to show the USER a list of 50 cars, their color, door count, cost, appeal, and purchase status.
My application sends information from Form1 to Form2 by means of a global variable on Form1 whose value is read by Form2.
This variable is basically used to tell Form2 what it has to do because it's value will change depending on different conditions.
All form2 is meant to do is load data from a database into DataSets which will "ported" to Form1 (the main form) for consumption. I use a Form for this rather than a class because there's a lot of data that will be loaded each time it's visible and I wanted[code]...
We are using a custom API in our project which provide an attribute for class fields/members which lets the interface to present a popup of some range values like "On/OFF" and pass the corresponding values of the choice to our code. The attribute requires a string array to know that values.We have many enumerations defined for these ranges,We are thinking to use Enum.GetValues() kind method to get a string array for this method.However, As we know the field declaration do not allow dynamic values in the declaration? so is there any other of doing same thing in efficient way.To clerify the problem i will write the examples below;
Current Working
<RangeLookUp("On:1","Off:2")> Public ASimpleRangeVariable As Integer
While I wanted to do like this or kind of
<RangeLookUp(SomeMethod())> Public ASimpleRangeVariable As Integer
Public Shared Function SomeMethod() as String()
'use Enum to get all the items as string values forexample Enum.GetValues & enu,.GetValues [code]....
Where SomeMethod suppose to return string array to be passed in the RangeLookup constructor.Which means if we change enumeration then we don't have to update the declaration.i know there are better ways to do it but due to some custom API, the ground is limited.
I am trying to work with classes and variables and don't seem to understand some behavior that is going on.
first off the class
Public Class csSession
Public ID As Integer
Public Name As String
End Class
Usage and behavior (example code)
Dim S1 as new csSession
Dim S2 as new csSession
S1.ID = 1
S1.Name = "1st Session"
S2 = S1
S2.ID = 99
When I assign S2 = S1 all the values of S1 passes to S2 but also there is a "link" or bond between the two variables now. If I change the values of S2 this automatically changes the values of S1!! Why does this happen and how can I prevent it? I just want to pass the variables values contained S1 to S2.
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 RepliesIntellisense in VB 2005 Express is showing lots of member items when hovering over a variable instead of showing the variable value. For example, when hovering over DataRow("Field"), instead of showing what's in Field, it shows all the members of the Datarow object.
Is there a way to change this, so I can see variable values without using the debug window like so, ?Datarow("Field")
how to "loop through a datagrid column to add values to a variable
in VB6 it was something like:
do while not .eof
myvariable = myvariable + datagrid1.collumns(6)
loop
I am trying to pass some declared variables to a stored procedure. Here is my
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles startpayrollButton.Click
Dim ssql As String = "select MAX(payrolldate) AS [payrolldate], " & _
[Code].....
I'm working on a vb.net application which imports from an Excel spreadsheet.
If rdr.HasRows Then
Do While rdr.Read()
If rdr.GetValue(0).Equals(System.DBNull.Value) Then
[Code]....
But when passing the value to the SQL insert I get: "Nullable object must have a value."
Solution:
Fixed by changing the datatype of the parameter in the sub I was calling and then using Variable.HasValue to do the conditional DBNull insert.
I've been literally googling for an hour now trying to find how to save variable settings to a file.I'm writing an application and I'm using alot of changeable variables. I want to be able to save these to a file so they can be loaded at application startup. I don't feel like using the regestry since I hate to write unimportant things to the registry.I remembered that I found a good example with simple code of how to do this with xml, but I can't seem to find the example now.
View 10 Repliesis it possible to create a variable that can have 2 values ASCENDING and DESCENDING? I need this for a linq querry in this way i dont need to write to querries ( one for each value)
View 5 RepliesI have hundreds of variables and need to see if they are duplicated. Is there a simple function I can use to achieve this rather than repeating the code for each? The variables have different types. Can you pass a variable name into a subroutine?
[Code]...
Can you create a string variable, that has 3 prespecified acceptable values?I need a variable that you can basically set it to one of three values and nothing else. Basically so you can't fat finger setting the variable in code.
View 1 RepliesI created a VB .NET exe application. When I use IL DASM, it shows the values of all the string variables in the code. These variable contains values that I would like to hide.the best way to obfuscate/hide these string variable values?
View 5 RepliesI'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]....
I am using the VB ReportViewer and report designer. I am not using the report wizard as I have had no success creating the report I want that way (I'm new to all this).
I have created a view holding all the columns I want to report on. Half the columns have values to be displayed in the body of the report in tabular form. The other half contain values on which I wish to group. Although there are several columns in this set, the values do not change except when the group value changes. Eg
Group col1
Group col2
Group col3
[Code]....
I cannot discover how to achieve this using the tools provided with the report designer.
I am working on a project where my class has to execute VB code provided by the user, to make it simple I am trying to recreate my own eval function, I am using the following code I found on the web to do this task.
Imports Microsoft.VisualBasic
Imports System
Imports System.Text
Imports System.CodeDom.Compiler
Imports System.Reflection
[Code] .....
The problem with code is that it can't access any variables or there values, so I have decided to get the variable names, there values types and there types dynamically and recreate them in the class that is being created dynamically. Any way to get the variable names there types and values in the current class or method, so that I can recreate them, and execute the user passed code, the user knows what variables are in the current class or method and there datatypes but he don't know there values as they may have changed, so he can't initialize them. Is there a way to do this, this code will be called in an asp.net page on page_load event, the code passed by the user is stored in the variable vbCode that is passed as a parameter.
I have a number of arrays (lets say two for the time being, but this needs to be scalable from 1-n). Each array represents a different "parameter" for the application I'm working on. I need to create a multidimensional array containing a set which represents each of the permutations of each of the "parameters". Effectively each row represents each permutation of the selected options for each "parameter" array.
For instance, say the first array of inputs is:
"Blue"
"White"
"Yellow"
And the second:
1
66
95
I need to create an array:
"Blue", 1
"Blue", 66
"Blue", 95
"White", 1
"White", 66
"White", 95
"Yellow", 1
"Yellow", 66
"Yellow", 95
The main work is in the "If Not (OutputTemp Is Nothing)" loop. Effectively I need to access the content in the first array with a "modulus" so that: (using the example above). I'm accessing the rows in the following method
OldArr,NewArr
11
12
13
21
22
23
31
32
33
worked it out.
Here is the code.
Public Class Permutation
Public TitlePrimary As String
Public TitleSecondary As String
Public Order As Integer = 0
Public Values() As Object
[Code] .....
other than GML (Yoyogames.com Game Maker Language), I am new to the coding world. The only "major" project I have completed using VB is a computer calculator that exactly mimics the capabilities of Windows 7's calculator. Yesterday, I began a Chatbot program for my girlfriend. Lol. I have used the instr() function to answer most of the questions or answers which are typed into the textbox1. I find this extremely troublesome because when using the instr() function you cannot say instr(textbox1.
Public Class Form1
Dim fos As String = "Foster: "
Dim ash As String = "Ashley: "
[code].....
I have this code to set array values and store them in a variable,
Dim productName As String()
Dim productPrice As String()
Dim productCategory As String()
[CODE]...
How do you get the variable values to output like this?
<input type="text" value="Chang Beverages $19.00" id="Chang" /><br />
<input type="text" value="Ipoh Coffee Beverages $46.00" id="Ipoh Coffee" /><br />
<input type="text" value="Gula Malacca Condiments $19.45" id="Gula Malacca" /><br />
Whenever I store values to a double-type variable, and ask to display it on the screen, there seems to always be a discrepancy, for example, I entered 7.416 to a textbox and assigned it to a double. When i ask for it to be displayed, it used to be that the 7.416 is returned to me. But just a few days ago, when I debugged my program again, it returns numbers like 7.4159987.......[code]....
View 7 Repliesis it possible to set a value of an item, for example: a textbox1.text = Empty.String at design time?
View 5 RepliesI have a text box on a Powerpoint Slide.The text box contains text that I need to use in an Excel program.The Excel program will berun from a button on a toolbar within Powerpoint.I need to be able to pass the text box text, from Powerpoint to a variable in Excel, so I can use it in my Excel VBA code.
View 1 RepliesI have to save the text boxe values of a form to a text file almost like a data record. I will be saving an Employee First Name, Last Name, Dept Number, and Phone Number. This I know how to do using streamwriter.
next form which we have to use stream reader to load one record at a time. The form has a next button to load the next record. How do I seperate each record (I am sorry for calling it a record if this is inappropriate) when use streamreader and how do I load a record at a time.
I know how to open a file and use streamreader, I just don't know how to read one record at a time and move to the next one.