Best Way To Store Custom Collection

Mar 29, 2011

I built a custom class and collection for the class for an app that I'm creating. What would be the best way for me to store it so that it will be available on the next startup of the app? It's a pretty simple class with a few strings, etc.

View 12 Replies


ADVERTISEMENT

Use A Custom Collection Derived From CollectionBase To Store Our Business Objects

Feb 26, 2009

We use a custom collection derived from CollectionBase to store our Business objects

[Code]...

View 3 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

Custom Control With Custom Collection Property?

Jul 11, 2011

I have an ASPX Custom Control which is supposed to load it's properties into an internal collection (defined with PersistenceMode.InnerProperty). Here's the ASPX

<cc:CustomControl runat="server">
<Queries>
<cc:QueryTypeOne ... />

[code]...

View 1 Replies

Store A Collection Into Ms Sql Field?

Mar 24, 2010

is possible to store a colletion into database field (ms sql server) is this case, the collection can contains different data types. What data type should be the database field ?

View 4 Replies

How To Store And Retrieve Collection FROM DICTIONARY

Dec 2, 2011

I am supporting one old project built on VB6.0.Can anyone please tell me how to store and retrieve collection from Dictionary.I searched over net but got nothing satisfactory.I really got strucked because of this.Please provide Any Example or Any Link,so that i can do self study.

View 1 Replies

Collection Of Object's To Store/retrieve The Data

Feb 8, 2012

I like the PHP way of doing things but, it seems I am stuck with using a Collection of Object's to store/retrieve the data I need. I have my Collection loaded with my Objects's and the code to iterate through the collection, my problem is I am unable to retrieve the "key" as it would be called in PHP (I believe in this case it is actually the name of the object).

Consider the following example:

Dim xDoc As XPathDocument = New XPathDocument(fName)
Dim xNav As XPathNavigator = xDoc.CreateNavigator()

Dim sender As XPathNodeIterator

[CODE]...

As you can see, I am navigating an XML document, and creating an Object with some Key/Value pairs. The Object would look something like this if it were in JSON:

{"name":"John Smith","address1":"123 Anywhere St.","city":"This City","state":"FL"}

When I iterate though the Collection I can only get the value of the object, but I need the Key, in this instance I want "name","address1","city","state" to be stored in a variable for each iteration.

View 2 Replies

Make A Data Driven App To Store Dvd Collection

May 12, 2009

I am using VS2008 Pro. I have a simple DVD database built. I'm trying to make a data driven app to store my dvd collection.One of my tables is Actors and is structured as follows.[code]On a form in my app I have a combobox. I'm trying to make it list FirstName LastName ie. Will Smith. I know how to make a query that'll take the LastName and FirstName fields and list it as Actor. I'm having a heck of a time getting it to do that in the combobox as it'll only let me use one field for the display and won't let me use the query I've made.[code]I keep getting some error about schema don't match default query. I know I could simply change the table to only have one field that holds first and last name, but from what I understand that's not proper db practice. I've searched this site and google until I was blue in the face at looking at soulutions that don't match what I'm trying to do.

View 3 Replies

Store Items In A Collection In String Array?

Sep 2, 2009

I have a string array called m_DirFileList and a collection called myFileCollection. I'm trying to loop through the items in the collection and store each one in the string array. It's not working though.

[code]...

View 2 Replies

Store Objects With Key In Some Sort Of Collection/Dictionary?

Jun 10, 2012

I need to Store Objects with Key like:

Key: <Fontname & FontSize> / Object: <Font Object>

Example content:

ArialRegular8 | <Corresponding Font Object>
ImpactItalic10 | <Corresponding Font Object>
TimesRomanRegular12 | <Corresponding Font Object>

These font types come from an external library, the real type is DocumentFont, I prefer not to store just values and recreate the font object later, so I need to store the object, and i want to be able to call Contains() later without looping. like for example Dictionary (of T Key, T Value), is this the best option? Also, to be able to call Contains(), i will have to overload function Contains() using an Interface or this is already built-in in some Collections / Dictionaries when using a String as Key?

View 3 Replies

Store References To A Bunch Of Structs In A Collection?

Oct 28, 2011

I would like to store references to a bunch of structs in a collection. The general scaffolding looks like this:

Structure myStructType
Dim prop1 as String
Dim prop2 as int
End Structure

[Code]....

now this doesn't work, because it's referencing the same memory. What I would really want is the 'pass reference by value' behaviour that is also used for reference types, so that I can easily keep producing more of them.

Is there any way to fix this other than to make the structs into classes? Is this actually a proper way to use structs, or do I have it all wrong?

View 1 Replies

Using Collection - Store Info Of Employees On Daily Basis?

Aug 25, 2010

I am trying to come up with a way to store 3 pieces of information for each employee in the company on a daily basis. So for instance:
Day 1: Joe, 8, 80
Day 2: Sam, 10, 90
Day 3: Bill, 5, 40
Day 4: Bob, 8, 40
Day 5: Sue, 2, 50
I am very new to collections and most of the applications that I build are Create, Read, Update and Delete type applications that don't really need arrays so I have almost no experience with either.

This is what I have so far.
VB
'
Dim iDays As Integer = NumberDaysPerMonth(Date.Now)
Dim DayNumber(iDays) As Integer
Dim EmployeeRecords As List(Of String) = New List(Of String)
For i = 1 To DayNumber.Count - 1
[Code] .....

View 4 Replies

VS 2010 - How To Create Small App To Store Music Collection

Jun 17, 2012

I am a beginner on Visual Basic but was able to create the 'skeleton' of the application I need to build. Basically, it is an application dedicated to keeping a check on the vinyl I have. When I buy a new record, I want to effectively 'Add New Record' on Visual Basic and be greeted with a page consisting of various forms such as 'Artist' and Title'. Once these are filled in, I want to click 'Enter' and for all that information to be converted to one of the pages within my application.

Here's an easier look at it...
There are LPs that have 10" and 12" sections.
There are singles that have 7" and 12" sections.

In the 'Add New Record' page I want to also have a drop down list with the above elements in, once 12" LP is selected and all the other forms are filled in and I click 'Enter' - I want the application to send it to the 12" LP section of the application.

View 11 Replies

Custom Collection In ASP.NET

Oct 6, 2009

I have built a class to store profile information and there is another class that inherits System.Collections.CollectionBase that actually holds the data objects. Now the issue is when the page is refreshed the entire class is wiped off the map.

View 1 Replies

Using A Collection : Store 3 Pieces Of Information For Each Employee In The Company On A Daily Basis?

Feb 27, 2006

I am trying to come up with a way to store 3 pieces of information for each employee in the company on a daily basis. So for instance

Day 1: Joe, 8, 80
Day 2: Sam, 10, 90
Day 3: Bill, 5, 40
Day 4: Bob, 8, 40
Day 5: Sue, 2, 50

most of the applications that I build are Create, Read, Update and Delete type applications that don't really need arrays so I have almost no experience with either.

VB
'
Dim iDays As Integer = NumberDaysPerMonth(Date.Now)
Dim DayNumber(iDays) As Integer

[code]....

View 19 Replies

Add Custom Procedures To Collection

Feb 18, 2010

I've lived in the VB6 world for the last 15 years and am only now starting to learn .NET. I've got a long way to go, but I am hung up on a fundamental issue about collections.I live and die by collections in VB6; I use them for just about everything I do.So I am very used to having the abilities that the intrinsic VB6 Collection has.Things like adding items with keys, referencing items by key or index, having the "Add" method return an instance of the object, being able to add custom procedures to the collection, having it strongly typed, etc.But all of the collection information I have read about in .NET doesn't really do all of this.(I am starting out in VB.NET, with the possibility of moving to C# at a later time, so i am trying to stay away from the Microsoft.VisualBasic namespace.)

View 11 Replies

Custom Control Collection?

Dec 29, 2011

I know how to create custom controls with all sorts of properties, but I cannot get a collection property to work

View 3 Replies

Using Custom File To Store

Mar 29, 2012

I made a custom file extension (.varia) and made the value notepad ++. Then I went into notepad++ and added it. Next I saved it as test.varia. But now I don't know how to make the program read it and store text inside of it.[code]

View 6 Replies

Looping Through Custom Collection Classes

Oct 5, 2011

I have a custom collection class. The main member of the class is a List(Of T). I did what this article says: [URl] For some reason though I can only foreach my collection once. The second time it tries it goes out of range because the position does not reset after the first foreach. What am I doing wrong?

[Code]...

View 4 Replies

Set Up A Custom App Configuration Element Collection Section?

Aug 24, 2010

I would like to set up a custom app configuration element collection section like this

<logSectionGroup>
<logSection name="Testttt">
<properties name ="Pride">[code]....

Properties would be the configuration element, and log section would be the configuration element collection.The problem is, I've only seen where you can have multiple instances of a single element instead of multiple elements.

<Section name="Section1">
<Section name="Section1">
<SubSection name="SubSection1">[code]....

View 2 Replies

Index Out Of Range Exception In Custom Generic Collection?

Feb 25, 2009

I wrote a class which imports System.Collections.ObjectModel. For the management of the collection, I've written:

Default Public ReadOnly Property Item(ByVal vntIndexKey As Integer) As ItemType
Get
Return CType(mCol.Item(vntIndexKey), ItemType)

[code].....

View 4 Replies

VS 2008 Transfer A Custom Event Through The Generic Collection?

Dec 22, 2009

To the point: I need to transfer a custom object's event through a generic collection object containing these items so that any class using the collection can see that changes were made to one of the items in the collection.

I.E. An item event that triggers a collection event

[Code].....

Due to the application requirements, I need the Collection and Items to send immediate notice of various changes that occur to the Collection Class and its items. I've already got my events set-up regarding for the Collection Class, but I'm struggling with coming up with a workable solution for raising events for the items.

I've got an event for the DeviceLayer item set-up, but how do you transfer that event through the CollectionClass so that any other class using it will see that there was a change to one of the items in the collection?

View 3 Replies

Why Use A Public Property Instead Of A Function To Expose A Custom Collection<T>

Jul 6, 2009

During a code review I looked at set of repository classes (in vb.net). I am used to seeing these repository classes full of functions that return collections (among other things) of your domain objects. However, this repository had 1 public property and 1 private variable that looked something like this:

Private _item as Collection (of Customer)
Public Item as Collection (of Customer)
Get...
Set...

In the "Get", there is code that gets a the Customers from the DAL and loads it in the private _item. What would the benefits be in using a property (customerRepository.Item) instead of plain old function (customerRepository.GetAllCustomers)? The "Property" way looks odd to me but odd doesn't always mean wrong.

View 3 Replies

Custom Collection Class Bound To DataGridView Text Formatting?

Aug 14, 2011

I have a custom collection class that is bound to a data grid view object.I'd like to try to do the following from the custom element class if possible.

1) I'd like the name of the column header to be a different text than the name of the public property in the custom class. i.e. Trade_Name should read "Trade Name"

2) I'd like to try to be able to manipulate the text formatting/color of the individual collection class element's items. i.e. for a profit/loss field I'd like to have the numbers be red if they are loss and black of they are profit. I know I could do this from the datagridview object in the form, but that can be cumbersome to raise events etc.

View 2 Replies

Implementing A Custom Control With A Typed Collection For Use At Design Time

Oct 14, 2010

I am having a problem with the Visual Basic property collection editor .

I have created a Custom Type

Public Class Field
Private Item As Integer
Private Name As String = "FieldName"

[ode]....

View 1 Replies

WinForms - Editing Custom Readonly Collection In Property Grid

Feb 19, 2010

I have a custom collection, lets says COL, that derives from ObjectModel.Collection. I have my own collection editor that works fine when a property, of type COL, is Read and Write enabled. However, if I change the property to ReadOnly, the open editor button stops showing in the property grid. As a test, I override my custom editor with the CollectionEditor, and that worked fine. So, my question is, what check is the property grid making, that CollectionEditor passes but my collection editor fails?

View 2 Replies

Use Custom SqlMembershipProvider To Store Users (and Roles) In Cache?

Feb 15, 2011

I'm developing a "small" warehouse-management WebApplication for few users(5-10 parralel) but with a complex authorization system(checking if pages,menus,TabPanels, UserControls and even single controls are visible or enabled) and permanent and frequent access. Because i've only limited experiences with the ASP.Net MembershipProvider, i'm unsure what's the best approach for following goal:

I want to hold all users, roles and frequently used masterdata in the Cache(in a Dataset). Hence every readonly access should be faster and causes less traffic than always using the database. On updates,deletes and inserts i would update the cached dataset and also the database.

Can i use or extend the SqlMembershipProvider to achieve this goal and if possible how?

View 1 Replies

Alter Items Added To Generic Collection (as Property Of Custom Class)

Jun 19, 2009

I have several custom classes in a VB.NET (VS2008) project which are related to each other through generic list collections. The lower tier classes refer directly to some of the parent classes (to make it easier to refer backwards up the chain). My question is, is it possible to add the reference to the parent class when the item is added to a collection, when that collection is a property?

Below is some sampling of code to illustrate.
Public Class FlexServer
Private m_FlexLicenses As List(Of FlexLicense)
Private m_Modules As List(Of FlexModule)
Public Property FlexLicenses() As List(Of FlexLicense)
[code] .....

In the code above I have the FlexServer class which refers has two lists as properties, one for FlexLicense and one for Modules. The FlexLicense class has a property to refer back to the FlexServer class that "owns" it. In order to update this property in code, I have to add the FlexLicense to the FlexServer.FlexLicenses list AND set the FlexLicense.FlexServer property. What I am looking for is, is there a way (in the property definition or wherever) to both add the item to the list and alter it at the same time?

View 1 Replies

Create A Custom ListViewItem Class To Store Additional Hidden Info?

Apr 29, 2011

I want to store additional information about a listview item using a custom class, but I can't seem to get it to work.I'm currently using this code to accomplish something similar using a listbox item.I just want to do the same thing with a listview.

Public Class myListboxItem
Public id As String
Public rootFolder As String[code]....

I forgot to add "Inherits ListViewItem" to my class.I'll update the code listed here to serve as an example for others.

View 1 Replies

InputBox Function - Program - Allow User To Input 5 Payrolls For Store 1, Store 2, And Store 3

Mar 22, 2012

I am coding a program that will allow the user to input 5 payrolls for Store 1, Store 2, and Store 3. The total of the 5 payrolls are then added together and shown in the respective Store's labels. A total label is also there to add up all the totals into one number. The numbers in the label must be in currency form. My problem is the numbers don't add correctly when I hit calculate. The first two numbers add together, but then after that the number just seems to subtract a random amount.

So far I have this --

Public Class Form1

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub

[CODE[...

View 14 Replies







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