Pass A Value Using Collection?

Apr 8, 2012

Passing a value through radio buttons that are in group boxes, this is a project that is upgrading an old program so I already have formulas for figuring out all the rest of the program I am just stuck with how to pass these values to the formulas.[code]...

View 3 Replies


ADVERTISEMENT

Pass A Collection Of Comboboxes To A Sub

Feb 6, 2010

I would like too generate a number of comboboxes at runtime and then pass them to a Sub, like this:[code]What is the correct syntax to use to pass the comboboxes collection to the Sub?

View 4 Replies

Pass Collection While Using .Invoke()?

Feb 14, 2011

I am using VS2010 (VB) and I am trying to dynamically call a function in another assembly. From my research, I seem to be doing it correctly --- but appearenty not since I get a run time error. {apologies if the code does not come out formated -- the code block helper is not loading for me}Here is the proto type of the function I am calling.

Public Class PrintLabel
Public Function ProcessMany(ByVal listRequests As List(Of Request)) As Windows.Forms.DialogResult
End Function

[code]....

When I step through in debug mode all seems great until I hit the .Invoke() line. It is then I get a paremeter count error exception.

View 3 Replies

Pass Collection Of Objects To BackgroundWorker?

Nov 19, 2010

I have an object of type Dictionary(Of Int16, Polygon) and which contains sometimes up to 15 or so Polygons that i am creating bitmap files with the Polygon. This can take like 20 seconds sometimes so i was trying to pass the full Dictionary to background worker as an argument but i get an issue when trying to access each individual Polygon inside of the Dictionary because the Polygons still belong to the UI thread. How can I access the Polygons inside the Dictionary with the backgroundworker?

Dim worker As New BackgroundWorker
AddHandler worker.DoWork, AddressOf MeasurePolygons
AddHandler worker.RunWorkerCompleted, AddressOf WorkerCompleted
worker.RunWorkerAsync(PolygonCollection)

that is how im calling the thread. PolygonCollection is the Dictionary(Of Int16, Polygon) that contains all the polygons that i will be creating a bitmap file out of.

View 9 Replies

Dictionary In A Dictionary - Collection Of Data To Pass Back ?

Apr 27, 2009

I have created a class with a function in it. I have a collection of data I want to pass back. I tried an arraylist first. Now I am trying to use a dictionary. My problem is that it creates the dictionary ok, but I am only get the last row of data from my

Function GetWeldAuditInfo(ByVal ResourceId
As
String,
ByVal VendorId

[CODE].........................

View 2 Replies

.net - Storing Subcollections (filtered Versions Of The Main Collection) Inside The Collection As Cache?

Jan 15, 2010

Is it good practice to store sub-collections of item X inside a parent collection of item X for caching 'filter-queries' which are performed on the parent collection? (They won't be used together (as in color AND type).) Or is it also ok to just Loop over the collection and return the correct entities in a temporary collection?

[Code]...

View 1 Replies

C# - Edit List Collection : Error Note Collection Was Modified - Enumeration Operation May Not Execute?

Sep 7, 2011

I have the following classes:

Product, Service and OrderItem

Product and Service must inherit OrderItem. So basically I want to store OrderItem object in my shopping cart and these object are store in a list.

Public MustInherit Class OrderItem
Private m_enuItemType As TypeOfItem = TypeOfItem.None
Private m_strUserID As Integer[code].....

View 1 Replies

Make A Custom Collection That Take Advantage Of The Collection Editor?

Feb 8, 2010

I have been researching for a couple of days now and to no avail. Does Anyone know how to make a custom collection that take advantage of the collection editor? I would like to be able to have 3 Color Values, 1 Boolean and 1 String.

View 15 Replies

.net - Collection Initializes For Read-only Collection Properties?

Jul 25, 2011

I'm trying to support Basic.NET on my framework so I'm trying to convert C# 4 code to Basic.NET 10. Microsoft is committed to "co-evolve" these two but I'm having a problem with collection initialization... I found that I can initialize a collection much like in C#:

[Code]...

View 6 Replies

.net - Search The Collection Of A Collection In LINQ Where Clause?

Apr 15, 2009

I've got the following ADO.NET Entity Framework Entity Data Model:I want to find all the Policyholders with both a Service of a given Id and also a Keyword of a given Status.

This LINQ Does Not Work:

Dim ServicesId As Integer = ...
Dim KeywordStatus As Integer = ...
Dim FoundPolicyholders = From p As Policyholder In db.PolicyholderSet.Include("Keywords").Include("Services") _
Where p.Services.Id = ServicesId _
And p.Keywords.Status = KeywordStatus _
Select p

The Where clause cannot search the p.Services and p.Keywords EntityCollections in that way.

[Code]...

View 1 Replies

Accessing And Adding Items To A Collection That Is In A Collection?

Apr 6, 2012

currently in my application I have a Global Collection that is a Collection of Collections.Currently I am trying to add items/ elements to one of the child collections of the Global Collection but I am unable to use the collections methods of the child.When I assign a variable to the child collection and return the collection it is just an object with the collection inside.

Ex:
Dim GlobalCollection as New Collection
Dim ChildCollection1 as New Collection
Dim tempCurrentCollection[code]......

View 3 Replies

Collection Index Must Be In The Range 1 To The Size Of The Collection?

Dec 17, 2009

I've been working with a CMS called InsiteCreations 2008. I'm running into an error I just can't wrap my head around. I would even be willing to compensate anyone a small amount over paypal, for a solution. The error is rare in occurance, and appears when clicking about 3-4% of links to other pages within our CMS.The full code page is quite large, but there seems to be only one function associated with the error. The error also only appears when not logged into the CMS. If logged into the CMS, clicking the link simply displays the page as normal. I have already checked permissions on the page from the CMS admin console, and it is public.

The error message is as follows:

Server Error in '/' Application.Collection index must be in the range 1 to the size of the collection.
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

[code]....

View 2 Replies

Search The Collection Of A Collection In LINQ Where Clause?

Apr 15, 2011

search the collection of a collection in my LINQ Where clause?

View 11 Replies

VS 2005 Update Table - If All Results Is PASS Then The Table2 Should Be Updated As Pass

Jun 8, 2012

I have two tables:

table1

case_no flow result
tc_1 001 pass
tc_1 002 pass
tc_1 003 pass
tc_2 001 pass
tc_2 002 fail
tc_2 003 pass


table2"

case_no result
tc_1 pass
tc_2 fail

Table2 should be updates from table based on the results... If all results is PASS then the table2 should be updated as pass... if any result is FAIL then the entire case_no should be updates a s fail..

View 7 Replies

Sockets - VB9 .Net 3.5 (2008) Code Works On The First Pass.Then Second Pass It Just Hangs On

Jun 19, 2009

This code was working consistently, but now...This code works on the first pass.Then second pass it just hangs on Code:Dim tcpClient As TcpClient = tcpListener.AcceptTcpClient() for about 2 minutesThen the code will fork for another pass, then fail.....

Code:Imports SystemImports System.TextImports System.Collections.GenericImports System.XmlImports System.Xml.LinqImports System.Net.Sockets

[CODE]....

View 2 Replies

Pass Data To Dialog - Manipulate And Pass Back?

Jan 15, 2010

Just started VB programming this week and have found a wealth of information about what I'm trying to do. Problem is, some of it is more complete than others.Here's what I'm trying to do:In Form1 (my main form), I want to instantiate a class that contains a couple of properties (speed setpoint and position setpoint). When I click a button, I want to pass this data to Form2 and populate two textboxes on Form2 with the properties of this object. I want to manipulate the property values on Form2 and click an OK button which closes the dialog and returns the manipulated data, updating the property values of the object. Here's the algorithm I'm following:1) On Form1, instantiate the class2) On Form1's "Pass Data" button click event handler, instantiate a Form2 object and invoke the ShowDialog method, passing the object as a parameter.

3) On Form2, overload the ShowDialog method to accept the object as a parameter and modify the method so that it returns the manipulated class data.4) On Form2, in the ShowDialog method, populate the textboxes with the class data that was passed in.Here's where I get stuck. If I press the OK button on Form2 (DialogResult.OK), it returns me to Form1, but what hook do I have in Form1 to receive the manipulated class data that the ShowDialog method is returning?Here's an example of what I'm thinking about:

Code:
Public Class Form1
Dim clsController1 As New MotionController

[code].....

I'm sure it's probably a very elementary question, but every explanation I've found seems to be incomplete.

View 2 Replies

.NET LINQ - Count Of Collection Within Collection?

Apr 14, 2011

Take the following scenario:

Public Class Store
Public Overridable Property Areas As List(Of Area)
End Class
Public Class Area

[code]....

What's the quickest way to get a total count of shelves for a store? I.e. for a store I get the total count of areas by using Areas.Count Or will I need to loop through each area and tally the count of shelves?

View 2 Replies

Asp.net - Add Controls To A Collection And Update From Collection

Mar 25, 2011

I have an ASP.NET app with lots of textboxes all over the page that need updating at various points through program execution. These textboxes actually belong to a certain class, so for easy updating I thought I could create a Dictionary(Of string, object) and add the control.ID and the control to it and then for updating do something like this:

[Code]...

View 3 Replies

C# - VB Collection - Convert To A Modern Collection?

Jun 26, 2012

I need to convert a VB Collection to a modern one, like Dictionary or Hashtable. For my approach, I need the Collection's KEYS. Googling tells me that it's impossible. Re-writing the entire application using new collections is not an option as the application is really old and large (converted from VB6 to VB.Net).Using the old Collection also is not good - as there are new components in development.Converting a - for example - Hashtable to Collection works:

using VBCollection = Microsoft.VisualBasic.Collection;
public static VBCollection ToVBCollection(this Hashtable table)
{

[code]....

View 1 Replies

Collection Of Lines - Using The Collection.contains?

Aug 12, 2009

I have a collection of lines and as i loop through through the collection, i need to see if it aleady contains a certain line; however, the contains method wants a string and i have stored lines, so how can i use this method to see if my line is already in the collection so i don't place it in there twice?

View 7 Replies

VS 2005 To Pass Or Not To Pass?

Apr 16, 2009

I am looking for some input. I am helping with a web application that is fairly large. We have some logic factored out into classes, not a true business logic layer (yet ). The classes are setup to pull values directly from the QueryString or Session variables and I'm not sure that that mehtod is proper or even a

The reason I would like some input is, there may be a chance to rewrite or at least refactor the code.

[Code]...

View 2 Replies

Print To A Collection() Then Prompt To Print The Collection?

Aug 4, 2011

Is it possible to print to a collection(), then prompt to print the collection?

[Code]....

View 2 Replies

Pass A Value From A Sub Procedure To A Function Procedure .... Pass The Whole Subprocedure To The Function Procedure Argument?

Mar 30, 2012

Im a student doing an assignment, how do i pass the value from a sub procedure to a function procedure....i want to pass the value from decSubtotal to a function procedure named CalculateDiscount; check out my code--

[Code]...

View 1 Replies

C# - .NET Collection Only In VB?

May 31, 2012

Why is the Collection in the Microsoft.VisualBasic library? Why is it not in a more general location. Is there a reason Microsoft "hid" it from C#?

View 3 Replies

Use Value From A Collection?

May 29, 2012

What I'm trying to do is get the value from a collection. While debugging I can see that the value from my collection is exactly what I want.

This line contains the value I want: Groups.Add(dn.Substring((equalsIndex + 1), (commaIndex - equalsIndex) - 1))

All I'm trying to do is export all the values to a textbox, and I can't seem to figure out how I can use it.

Below is just some more of the code I'm working with.

The property of the line is {Microsoft.VisualBasic.Collection.KeyValuePair} the key has no data, but the value has what I need.

Dim equalsIndex As String
Dim commaIndex As String
For i As Integer = 0 To propCount - 1

[Code].....

View 3 Replies

.net - Add XElements To A Collection?

Oct 21, 2010

I am populating an XML structure (using VB.NET) to pass to a web service. Here is how one piece of the structure is filled, and the rest of the structure is filled in a similar manner:

Private Shared Function GetSpecialties(ByVal specialties As System.Data.Linq.EntitySet(Of Provider.provider_specialty)) As XElement
Return _
New XElement( _

[code]....

Some pieces of the structure can contain up to 30 elements. Each record takes about .1 seconds to create, and it needs to create about 35,000 records, so the whole process takes about an hour.Is there a quicker way to fill an XML structure like this?

View 1 Replies

Add A Structure To A Collection?

Sep 18, 2011

Recently I found that I'm not able to instantiate a structure for an array:

Dim mObjectLists() As New objectLayout

Ok, fair but It's an easy way to store a bunch of data in an array instead define a class. And after that I tried to define this:

Dim mObjectLists() As Collection

And add structures to the collection. But it says you should instantiate the reference object first. I searched about creating own Collection based on the base collection class but I think It's wasting time to write a code with class inheritance instead the first sample.

View 1 Replies

Add Timers To A Collection?

Jul 19, 2010

how can I place all timers on a form into a collection

View 2 Replies

ASP.NET / VB Iterate Through Collection

Jul 7, 2010

[This is a simplified example] I have a collection ("myCollection") in which exists three entries: ("hello", "goodbye", "welcome"). I want to iterate through the collection and if in the collection there is the entry "welcome" I want to take one action, if that entry doesn't exist I want to do something else. Like this (pseudo):

[Code]...

View 1 Replies

Bug In Collection Class VB?

Aug 16, 2009

The following code creates a Collection where every Item is assigned a value equal to the last item added. At the end of adding for example seven items all the entries are identical to the last one added, although each has the correct key

The parameter passed to the function - aCOA() - is a comma delimited string of three strings.

The code is as follows
Public Function myCOA(ByVal aCOA() As String)
Dim thisCOA As New Collection
Dim keyCOA As String

[Code]....

Is this a bug in the code or in the Collection Class. I have traced the operation of the code and all seems OK until the second entry is added at which time the first entry Item get the same value as the second entry Item and so on.

View 2 Replies







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