Passing String Variables In Array List
Jun 12, 2009
I'm having difficulty passing a variables in a an array list. [Code] I have to pass the paramvals array to the function. The paramvals array contains the string but not the value of variable of that name. For example, parmaval(0) should contain the value of vSequence but it showing me that it contains string "vsequence".
View 3 Replies
ADVERTISEMENT
Jul 29, 2011
I want the Function to accept List(Of String), Array & String and similarly return List(Of String), Array & String respectively. The Function simply adds a string (month) to the input collection. I just want to use it for string, array and list with needing to think of conversions.
[Code]...
View 2 Replies
May 27, 2010
I'm having problems with marshaling in VB.NET to C++, here's the code :
In the C++ DLL :
struct APP_PARAM
{
[code].....
View 2 Replies
Jan 19, 2010
Following is the format of the data stored in my arraylist.
A-Amsterdam
B- Brussels
C-Canada
so and so forth. I wan to search my array list by passing just the first few characters till '-' So if i have something like AA-Test then i want to pass just 'AA' to check if it exists or not.
I know that i can use contains or binarysearch but it does not serve my purpose as they both compare objects.
View 2 Replies
Sep 2, 2010
Ok so I have an array and wish to add the variables of the array to separate lines of the list box. I came across this which in some ways worked but also didn't. The second thing mentioned on the page was to us:
ListBox1.DataSource = Form2.Title This works the first time you run it but if you try to run it again nothing happens. So using the above or something else how can I get it to update the list box? Another thing I tried was to use the DataSource method but instead to clear the list box first, but that turned up an error
View 14 Replies
Sep 22, 2011
I have a question regarding calling a C++ dll from vb.net.My C++ dll has a function that takes char **data (2D char array) as a parameter like this for example.
extern "C" int fn(char **y_data)
View 7 Replies
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
Oct 21, 2011
I have a simple query but I am just not able to get it right. Have a look at my sample code below:
Sub Function1
My Code Here
Function2(Year,Month)
End Sub
Sub Function2(Year,Month)
Dim Str as String()
for 1 to 30
Dim MyDate As New Date(Year, Month, i)
Str = MyDate.DayOfWeek.ToString()
Next
Return Str
End Sub
View 7 Replies
Jun 8, 2009
how to use a String Array for passing Values
View 3 Replies
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
May 12, 2010
My problem is, in VB 2008 I need to convert this[code]...
View 8 Replies
Feb 21, 2012
I have a form that asks for a name, and a phone number, it has 3 buttons, a add customer button, show list button and an exit button. When the add customer button is clicked, it increments intCustomer variable, formats the phone number, makes sure only the first letters of the name are capitalized and creates an ID that is the first 4 letters of the name plus the customer number, the show list button takes ALL customers added to the array and displays them into a multi-line text box, like so:
ID Num Customer Name Phone Number
JOHN-1 John Harry Peters (111) 111-1111
Paul-2 Paul J Rodgers (111) 111-1111
Etc...
The area where I am completely lost in, is how to add the consecutive customers to the array, in the correct way. here is my code in its entirety
Public Class frmCustomerName
Dim intCustomer As Integer = 1
Dim names(9, 2) As String
[code]....
View 1 Replies
Apr 15, 2012
I am trying to get each item in a list box into a string array. However, I keep getting an index error and I am not sure why. I am doing this so i can perform a LINQ on the array.
Error:InvalidArgument=Value of '16' is not valid for 'index'.Parameter name: index
[code]...
View 1 Replies
Mar 30, 2010
I have my own little tutorial about passing variables, and if you'll look at the code below, you'll see how I am passing the variable from one sub to the secondsub. Here's my question, how can I pass a value back from the 2nd sub to the 1st? So if I want to sum intA plus intB, and want to return that value to the first sub, how do I do that? [code]
View 18 Replies
Oct 26, 2009
I want to convert a List (of Long) into a string array.
Reason: it's a list of database IDs and I want to make a comma delimited string to pass into a stored proc.I tried this:
Dim commaDelimitedList As String = String.Join(",", itemIDList.Cast(Of String)().ToArray)
but I'm clearly not using the Cast correctly since it throws an exception:
System.InvalidCastException: Unable to cast object of type 'System.Int64' to type 'System.String'..
Is there a way to get Cast working for this, or am I stuck with ConvertAll and a delegate function?
View 3 Replies
Mar 8, 2011
I have a generic List(Of Customer). The customer class has a name, address, and phone number properties. I also have a property of another class that accepts a customer name array. I am able to do this by doing the following:
Dim names As String()
Dim i As Integer = 0
'customer.GetCustomers is a List(of Customer)
[Code]....
Is there a better way to convert this to a string array?
View 1 Replies
Apr 21, 2011
I have a program that I am writing that asks the user for information.The program takes that info and passes the strings to a module that has a set of case statements for comparison.The program was working just fine yesterday, and now it acts like there is no information being passed to the module for comparison.[code]
View 2 Replies
Jan 21, 2009
I have an ASP.NET 2003 web application. There is a .vb module file within that application. Is there anyway I can pass a session variable into this .vb module from a aspx.vb page?
View 2 Replies
Sep 16, 2009
I have an application I have built which is basically a decision matrix. I would like to add it to a current database as a button on the form. When the button is clicked I would like to pass header information to the executable (two variables).
I can modify the code but I am not sure where to begin?
View 8 Replies
May 17, 2012
I have a Form1, the user types a "Client ID" in a textbox if it's not a valid one, it opens a Form2 in which the user selects the correct "Client ID", once selected he presses an OK button. And there comes the porblem.. it opens a new Form1 with the Client ID that he selected from Form2, but I still have the first Form1 opened.
I have two Form1 opened...
I which to keep the original Form1, but with the value sent from Form2..
I'm using this code:
Code in Form1
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[Code].....
View 2 Replies
Apr 27, 2009
I am using Visual Basic 2008 for this assignment. I have a project that I am working on and I need to be able to use form variables across the entire project.
I have looked on other forums but no definitive answers.iI have declared variables as such Public StrV21true As String and "Public StrV21False As String
Now apon assigning a string to the variable with an If Then Else Command, I go to the next form expecting that the assigned variable will be available for use in this second form but to my dismay it tells me that the variable has not been declared and will not even show up in Intellesence. Like I said before from research on the net I am using the public class in Form 1 to hold the variables and am kind of expecting the public class variables to be available through all the forms in the project. I would really like to know how to do this so as I can finish my project for class.
View 4 Replies
Feb 8, 2012
I'm having trouble passing Variable information through classes, here is what I mean.
Example:
On my Form I call on Test.Result
Test is my Class
[code].....
View 1 Replies
Nov 19, 2010
I have two forms and I'm trying to pass a declared variable from form1 to form2 and then pass that variable in a sql query that I have in a dataset that is bound to my form. I know that my query works but it's not producing any data. I have debugged my form and can see the data being passed in the variables elsewhere on the page but I'm not sure of the syntax within the query.
[Code]...
View 5 Replies
Jan 24, 2012
I am getting an "Automation Error" with the following:
Dim sheetdate As String
Dim sheetdate1 As String
sheetdate = "7/1/2011 23:59:0"
[code]....
I need to pass two variables to the WHERE clause. If I manually input 'sheetdate' and 'sheetdate1' into the clause -
WHERE (((ticketorders.TimeStamp)>#7/1/2011 23:59:0# AND (ticketorders.TimeStamp),#7/2/2011 23:59:0# ...
everything works fine. The problem is I have multiple sheets and I would rather not have to add the entire sub-routine to each and every sheet. My thought is, it would be easier to create a PUBLIC sub and pass the time values (sheetdate and sheetdate1) to the WHERE clause.
View 2 Replies
May 21, 2009
I've got a form in my MDI container. Lets call it Form1. I now want to show a dialog box (Form2) and pass the primary key from Form1 to Form2. Do i create a public function on Form2 called SetMe() or Do I create a public on Form1 And read from it? From a best Practice point of view, How would you go about it?
View 1 Replies
Dec 9, 2009
I�d like to pass the username and password within a link to a browser using VB code. This link works "http:192.168.0.26:81/forum/login.asp?username=test&password=test" when used manually but not when used within a code:
Dim username, password As String
username = "test"
password = "test"
WebBrowser.Navigate("http:192.168.0.26:81/forum/login.asp?username='" & username & "'&password='" & password & "'")
The username and password are passed onto the web page within single quotes as �test�.
View 2 Replies
Aug 31, 2011
I am passing 2 variables from form1 to form2. In form2 I want it to where it will filter my dataset according to the variables in form1, before it's displayed. In form1 it works, but when passing those values (JT & WRID1) to form2, it doesn't work.
Form1:
Public Class Form1
Friend JT, WRID1 As String
Private Sub ShowForm2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShowForm2.Click
JT = Me.dgvWLog.Rows(dgvWLog.CurrentRow.Index).Cells("dgvJT").Value.ToString
WRID1 = Me.dgvWLog.Rows(dgvWLog.CurrentRow.Index).Cells("dgvWRD1").Value.ToString
End Sub
End Class
Form2:
Dim s As New Form1
Dim JT As String = s.JT
Dim WRID1 As String = s.WRID1
Me.DataSet.Form2_Get.DefaultView.RowFilter = "WT = '" & JT & "' And WRID1 = '" & WRID1 & "'"
View 1 Replies
Apr 12, 2011
I am working on a program, and I would like to have the program pass a name from on form to another.
This is my code :
form 1 :
Public Class Form1
[code].....
View 8 Replies
Aug 28, 2009
I'm using String.Join to attempt to turn an array list into a string that is comma separated, such as "1,2,3,4". I can't seem to get the syntax working.
Here's what I'm trying:
Dim aryTest As New ArrayList()
aryTest.Add("1")
aryTest.Add("2")
aryTest.Add("3")
[CODE]...
How can I go about doing this properly?
View 3 Replies
Apr 7, 2010
I'm writing a program that reads a directory of xml files (not well-formed), parses the xml, and dumps the data into an Excel Workbook.The file contents are similar in that they have many common xml nodes/attributes.Some files have additional nodes/attributes.The xml in these files represent configuration settings for a Web Application, one file per user.The expected output is a worksheet with a column for each node/attribute combination and a row of node/attribute values for each user.I'm just about finished with the program, but I've run into a bit of a snag.As the final step in the process, I need to loop through a generic list of array objects (that represent a user row) and send the array elements to Excel.I don't know the correct syntax to get the array objects out of the list and have been unable to find sample code specific to generic lists of array objects.[code]
View 3 Replies