I started making a very simple application where a list of names is shown in a checked-listbox. Now I would like to add a date as a second column value. This means i have two use a two-dimensional array. What containers could be suitable to visualize a 2 dim-array on a form?
I was thinking as an alternative I could keep it one dimensional and use a delimiter. Would there then be a method to format this date on the extreme right side of a listbox? I guess I would have to extract the date part, but I don't see how i could position it in a listbox.
I am working with VS2010 and using a windows forms project.
I have a string containing many lines. Each line has many values separated by commas. Basically it's in CSV format. The number of lines is variable but the number of columns is always 7.
I can get each line into a one dimensional array using Split(Var, Chr(10)).
I'd like to make it a two dimensional array where the second dimension contains each comma separated value.
I've got
Dim VarArray1() As String = Split(VarText, Chr(10)) Dim VaryArray2(0 To VarArray1.Length - 1, 0 To 6) As String
Is there a quick way to get the contents of VarArray1 into VarArray2. I know I can do the following.
For Counter = 0 to VarArray1.Length - 1 Dim line as string = VarArray1(Counter) Dim Values() as string = Split(line, ",") For Counter2 = 0 to 6 VarArray2(Counter,Counter2) = Values(Counter2) Next Counter2 Next Counter
But is there a quicker way to do it that doesn't require passing through each element of VarArray1 and then passing through each element of Values.
The eventual goal in all of this will be to find the highest value in the 3rd column (the arrays are strings at this point because not all columns are numeric). To do that once I get the values into VarArray2 I suspect I have to pass through each element VarArray2, i.e. VarArray2(Counter,2). Unless I can copy the whole third column into a SortedList?
I am having a problem understanding the following error message:
Value of type 1-dimensional array of string cannont be converted to 2-dimensional array of string because the array types have different numbers of dimensions This line seems to be causing the error:
New String((13) - 1) {}
I did a Google search on this but didnt come up with anything useful. I didnt even change the code.I just found this example online and copied/pasted it into a project that Im working on.
All code is listed below!
Calendar.aspx.vb Imports System Imports System.Data
I developing a roster application (asp.net with VB + sql server) to let user input shift duty record, proposed screen as follows:for the database design, each staff will have one record per day.[code]I want to create a multi dimensional array to bind the gridview.Is that correct that I create a arraylist (for 7 days) and then a subarray for each day? How can I create a 7 dimensional array & sub array under this 7-D array in asp.net + VB ?
I've been working on a VB project where I use a 1st drop down list to select a movie category and then in the 2nd drop menu, movies from that category will be displayed. The movies are stored in a 2-dimensional array by category. I've been able to edit my array but I'm having problems with my .AddRange() function. What would I have to put in those parentheses for the list (for each category) to appear in my 2nd combobox when the category is selected?
I declare 2-dimensional array at class level Dim delItems(9, 9) As String The array elements are then each set to "EMPTY". I create a new form in memory Dim frm As New Form I create a new DataGridView add columns to it and add it to the new form Dim d As New DataGridView frm.Controls.Add(d)
Now the problem.....this code give error when try to load contents of 2-D array into DGV: For i As Integer = 0 To 9 d.Rows.Add() For j As Integer = 0 To 9 d.Item(i, j).Value = delItems(i, j).ToString Next Next
Error is ArgumentOutOfRangeException (Index was out of range...) When I check value of loop control variables, i = 0 and j = 1
For my programm I am supposed to store the minimum points in a five-element, one dimensional integer array name points. And I need to store the grades in a five-element, one dimensional string array named grades. These arrays should be parallel arrays. I am supposed to code the display grades button click event procedure so that it declares both arrays. It also should search the points array for the number of points entered by the user, and then display the corresponding grade from the grades array.
Here is my code: Option Explicit On Option Strict On Option Infer Off Public Class Grades Private Sub exitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles exitButton.Click [Code] .....
I have an application in VBA that gives to my VB.Net dll one bi-dimensional variant. It is a an array, in which every component is a another array containing two positions.
I want to get this two-position array. When I am using VBA I can access directly the data from each position by doing:dataArray(index, 0) or dataArray(index, 1)And when I want to get the two-position array I can use:
Dim posArray as variant posArray = dataArray(index)
I have a VC++ DLL, which returns the sum of two long double values, passed as one dimensional array?l the right syntax to pass array to this dll from vb.net
currently, my code snippet is as follows: DllClass.vb Imports System Imports System.Collections.Generic
Here are the facts: Consider the following program. Sub Main()
[Code]....
Compiling the program in Visual Basic Express produces no errors. However, if the program is imported into the Excel Developer environment; I get the following error: Expected: end of statement with the equal sign highlighted. A side comment: About eight years ago, I wrote a Visual Basic simulation program to study financial trends. I found that version of Visual Basic user frendly! I find the 2010 version very difficult for doing simular projects.
i want to make a vb.net program that reads from a text file a movie, with the help of a Open Dialog (called openFD in my program) (we don't know how many movie we've got), the actors, the release date, the country, and the rating.
First question: How can I make a 2-dimensional array? line(0,0) - Movie1, ... , line (1,5) - Rating2. Here Is my try, but it's not good:
Dim line As ArrayList = New ArrayList() Dim itm As ArrayList = New ArrayList() Dim i As Integer = 0
[code]....
And here is the code for the Delete Button. It deletes a movie from the listbox, but the details of the deleted movie remains for the next one, I must delete the details for the deleted movie, too.
i'm extremely confused. my professor gave us this as the FIRST problem to do in this intro to VB class...on page 380 of our text. it is due today and i have been up all night trying to figure out where to even start. i'm so frustrated. could someone please help me and steer me in the right direction? use a one dimensional array to solve the following problem: a company pays its salespeople on a commission basis. the sales people receive $200/week, plus 9% of their gross sales for that week. for example, a salesperson who grosses $5,000 in sales in a week receives $200 plus 9% of $5,000, a total of $650. write an application (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assuming that each salesperson's salary is truncated to an integer amount): $200-299, $300-399, $400-499, $500-599, $600-699, $700-799, $800-899, $900-999 and over $999.
Allow the user to eanter the sales for each employee in a TextBox. The user clicks the Calculate Button to calculate the person's salary. when the user is done entering this information, clicking the Show Totals Button displays how many of the salespeople earned salaries in each of the above ranges.
I'm having trouble with this specific code and on arrays in general. This is what I am asked to do: "In this exercise, code an application that displays the number of students earning a specific score. Declare a 20-element, one-dimensional integer array named intScores with the following 20 numbers assigned to the array: (88, 72, 99, 20, 66, 95, 99, 100, 72, 88, 78, 45, 57, 89, 85, 78, 75, 88, 72, and 88). Code the procedure so that the user can enter a score from 0 to 100. Then the procedure should display using a message box the number of students who've earned that score."
First off, I do not know what I'm doing wrong with my array.. it says there's an error in line 31 saying "variable intSubscript hides a variable in an enclosing block" but I don't know what that means. And lastly, once that is sorted out, I don't know how to code a message box to appear saying how many students have received that score.
I want to put a two dimensional array into a stack and then check the stack to see if it contains the first dimension of the array. Is there any way to override the contains function to do this.
I am writing an auto insurance application.I need to sort a three dimensional array in descending order based on an integer value in third field in the array.The CalcPremium function returns an integer value.
Public Class Form1 Dim socleag(6, 6) As String Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Program is read the file and stores it in the array.
[code]....
I tried to convert this two dimensional to a col and row table. I need help. what I am going wrong with the code.
I am trying to design a little application that allows user to enter daily attendances for 4 weeks.exercise 11, Murachs beginning vb.net) The form consists of a combo box that list the number of weeks, text boxes to enter daily attendances fro mon - fri, a button to save the entries, a button that calculates the average weekly attendance and a button to close the form.
The issue I am having is saving the user entries. I use a 2 dimensional array with 4 rows and 5 columns. Within the click event of the save button I user a for loop to loop through the array and populate each dimension depending on the week selected. Once they are saved I clear the text boxes, set the combo box index to the next position , I.E selecting the next week unless it is week 4 hence the limit has been reached. Finally move the focus to the monday text box.
When I run the code I keep end up with 2 errors depending on how i change the code. The first is that i exceeded the index of the array and the second is that "" cannot be cast to an integer. My code thus far is shown below. I have edited the data so much that I am now just confused.
I am pretty new to vb.net 2005 and I'm getting the following error [code]it states that "value of type 'sessioncreate.partyid' cannot be converted to '1-dimensional array of sessioncreate.partyid'
I am pretty new to vb.net 2005 and I'm getting the following error
Dim objFrom As New SessionCreate.From Dim objFromPartyID as New SessionCreate.PartyID objFromPartyID.Type = My.Settings.FromPartyIDType objFromPartyID.Value = My.Settings.FromPartyIDValue objFrom.PartyID = objFromPartyID
it states that "value of type 'sessioncreate.partyid' cannot be converted to '1-dimensional array of sessioncreate.partyid'
i have a problem with my system.. i have try many time and i cannot solve the problem..here is my question
Use one dimensional array to solve the following problem: A company pays its salesperson on a commission basis. The salesperson receives RM200 per week, plus 9% of their gross sales for that week. For example, a salesperson who grosses RM5000 in sales in a week receives RM200 plus 9% of RM5000, or a total of RM650. Write a program (using an array of counters) that determines how many of the salesperson earned salaries in each of the following ranges (assumes that each salespersons salary is truncated to an integer amount):
A) RM200-RM299 B) RM300-RM399 C) RM400-RM499 D) RM500-RM599 E) RM600-RM699 F) RM700-RM799
I keep trying to write a two dimensional array to reflect four different pizza sizes available in 2 different crusts. So basically I am trying to create 4 elements (one for each size) to initialize before the form loads. But every attempt just crashes in debug
i'm trying to tokenize my text but while doing that i'm facing a problem
would anyone like to solve it
Public Function lexemes(ByVal str As String, ByVal seps As String) As String Dim regexpression As String regexpression = Regex.Split(str, seps) Return regexpression End Function
i'm trying to tokenize my text but while doing that i'm facing a problem
Public Function lexemes(ByVal str As String, ByVal seps As String) As String Dim regexpression As String regexpression = Regex.Split(str, seps) Return regexpression End Function