Collection Of Locations - How To Skip First Record

Apr 7, 2009

I have a collection of locations for a sales person, allowing them to send an item to multiple locations. I want to start reading at index 1 since I am using a collection. I saw an example where you can say something like "+ 1" (e.g. myitem.SelectedIndex + 1) to skip the first record. How can I skip the first record for the following:

Public ReadOnly Property Customer() As ICustomer
Get
Return CType(Me.CustomerList.Item(Me.CustomerNumSelected), ICustomer)
End Get
End Property

I tried to say Return CType(Me.CustomerList.Item(Me.CustomerNumSelected + 1), ICustomer) but it returns an error saying "string cannot be converted to a double". without the + 1 in there, I get an error that says "collection index must be in range 1 to size of collection".

View 5 Replies


ADVERTISEMENT

How To Skip Record That Cannot Be Inserted

Aug 23, 2009

I am looping through several hundred records from a XML file and inserting in SQL server 2008 using LinQ from my Web Service.My question is, for some reason if a record is not inserted it is coming out of the loop and going to the Catch block directly.

View 2 Replies

WPF - Moving To New Record On Collection

May 23, 2009

I'm just getting started with collections (ObservableCollections). I have a WPF screen with a DataGrid to the left and TextBoxes to the right of the screen. The DataGrid is bound to the ObservableCollection (Activities) and I can click up and down the DataGrid and see my TextBoxes refresh with the correct info. I can then alter the info in the TextBoxes and save it back to the DB. All works perfectly!

However, when it comes to Adding a record to the collection I'm lost as to the correct approach. I'm using the Add method as shown below, but how do I move to this newly created record so it can be edited? I've tried a dozen approaches but I've yet to find a correct approach. The TextBoxes just remain focussed on the last edited record.

Private Activities As ObservableCollection(Of ActivityRecord)
Private Sub AddMode()
Dim _ActivityRecord As New ActivityRecord(0, DateTime.Now, Nothing, "", gWorkerID, "")
Activities.Add(_ActivityRecord)
'Code to move to the newly created record should go here

View 1 Replies

Adding To Collection Just Continually Duplicates Added Record?

May 7, 2010

I have run into this problem a number of times, and I am not sure what I might be doing wrong - or if this is just a bug, or not going to work.I have a collection that I setup on my own (eg, collection class). I then cycle a Log file that has text entires and I read those, and then parse the entry and attempt to add it to my collection.

But as each entry is added, ALL records just get duplicated - in other words, as I add entry 2, both entrys 1 AND 2 wind up with the same values - as I add 3, all 3 entries get the same value - and this continues no matter how many entries. For example,
if I added 100 entries, I would have 100 duplicates of the last record added.I have stepped through the debugger and watched this occur and just cannot figure out why this is not working as it should. Here is the code...

While
Not objReader.EndOfStream
' Read one full line

[code]....

No matter what I do, my lstSent collection just winds up with EVERY entry being the same as the last entry added.

End
IfFalse'
Add the elements into the collection if its a "Sent" itemElem = objReader.ReadLine

View 7 Replies

Retrieve The Record And Display The Record In A Listbox Displaying The Time Field As The Text For That Record?

Apr 18, 2009

I hav a web service which pull records from a database and I am hosting these services in IIS which works fine but I am trying to retrieve the record and display the record in a listbox displaying the time field as the text for that record.I have created the following function

public sub get_data()
dim dt as new data.dataTable
dim service as ws webservice.webservice

[code]...

View 1 Replies

Quering Record - Check A Record In Database Before Inserting A New Record

Aug 9, 2010

I am trying to check a record in database before inerting a new record here is my code but problem is when i enter a names first alphabet it imediatly populate massage. i want to check it after entering whole name

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Try
Dim cnString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &

[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

Get All Picture Box Locations?

May 12, 2012

I want to get all picture box locations. I am remotly creating them so i couldent just get each one individualy.

View 2 Replies

.net - Compiled Class In Two Locations

Aug 22, 2011

I'm a tad stuck trying to get a List to load from the ViewState using ASP.NET 4 and VB.NET. When I try to retrieve a collection using:

[Code]...

View 1 Replies

Drawing A GDI+ Path In Several Locations?

May 4, 2011

After a path is defined with all its components, is there a version of the DrawPath that allows the composite object to be drawn in locations other than the initial locationsFor example, the code shown below displays an ellipse and two rectangles in a specificocation. To also display the same objects in one or more other location,s, is it possible to disply the defined path at other locations or is it necessary

View 2 Replies

Picturebox Clicking Certain Locations?

Jan 13, 2011

I am working on making a picturebox that when clicked in a general location it will do something. Is there a way to make a grid out of a picture so when a certain slot on that grid is clicked an event will happen? It cant be an exact location, because that will be too hard to click. but a relative location would be perfect.

View 3 Replies

VS 2008 - Deployment Locations ?

Feb 14, 2010

The file locations for a setup package using Standard Edition? I have added an .xls file to my project, marked it as Content and as Copy Always in the properties for that file. The XLS file I added to the project is from my user Apps folder in the Roaming sub folder. Other simple .TXT files are in my UserMy DocumentsData folder and each file is also maked as Content and Copy Always. When I create the setup package all goes well. I have a setup.exe and an .msi file. When I test it by installing it on my PC of course the program knows where the files are because it's my PC. In the program folder created as C:Program FilesMyProgram I find the .exe plus the XLS and TXT files, but these XLS and TXT files are not used from the program folder. How might I know if an installation made by another user on another PC elsewhere is going to load files in their user apps or user documents? I need to be sure that the additional data files deploy to the correct location (whatever I want that to be) on a remote PC.

View 3 Replies

VS 2008 Object Locations?

Apr 23, 2012

I would like to make a simple functions for my program but I can't figure out what to do. I want the picturebox PBplayerbullet to be moved in the midle top of the picture box PBplayerim I know that if I use PBplayerbullet.location = PBplayerim.location will it to the top left part of the picture, but how it can be moved to the midle ?

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

Acceptable Application Folder Locations?

Jan 29, 2009

My application may be run by a number of different users and needs to be able to read and write to the same filles irrespective of what user is logged on to the PC.What is an acceptable location to store these files?i.e. a folder that has read/write permissions set as default.

View 2 Replies

Allow The User To Add Locations For Direct3D Icons?

Jan 23, 2010

I'm making a scripter to allow the user to add locations for Direct3D Icons, but I'm trying to make a sub for it...

Public Sub icoadd(ByVal mod1 As String, ByVal mod2 As String)
loc.X = defined.Location.X
loc.Y = defined.Location.Y

[Code].....

View 4 Replies

Application Settings File Locations

Dec 16, 2009

I want define where my application and user settings files will be located.I would also like to rename them.For example my project will have a number of folders located inside the application folder when deployed.One of those folders is labelled "Cfg" and i want my application settings files to be saved in there.This is including the user settings, i dont want to localize the user settings file as is done automatically (at least not at this stage).

View 3 Replies

Comparing Characters At Different Locations In A File?

May 2, 2009

My card program generates a text file AllCards.txt - I want to know when the first character in this file is identical to the 3rd, 5th, 7th, or 9th. In this case I would need A (1st char) checked against the 5 (3rd char), 5 (5th char), 7 (7th char) and 8 (9th char).

[Code]......

View 12 Replies

Get X And Y Locations Of A Moving Butto In Vb 2005?

Mar 15, 2009

I used the code below to make the button move but now i need to get the current location of the X and Y and show it in a label on the form..ex

[Code]...

View 2 Replies

Move The Mouse To Different Locations In Another Application?

Feb 11, 2012

How can I move the mouse to different locations in another application. Currently, I used HDC and HWND to get my window's handle. (Also FindWindow). So, is it possible to like MouseMove(HDC, 5,5)?

View 4 Replies

Moving A PictureBox To Predefined Locations?

Jan 22, 2011

I'm working on a little board game we play here in Jamaica just to see how it would look and as a sort of challenge for myself while on vacation. I'm however stuck on how to make my markers (PictureBoxes - two per player) move along the board.So heres my problem; I have 40 slots where the picturebox can be moved to (eg picturebox1.Top = 324, picturebox1.left=243). Now moving to these slots are determined by the roll of a pair of dice. How can I assign a variable preferably an integer for each slot so when the dice is rolled I can just do a little addition as to where the markers can be moved?

View 7 Replies

Put Files In Certain Locations And Create Own Installer

Feb 11, 2009

I am trying to create an install for my application that I have just created using visual basic express. I want to be able to tell it to put files in certain locations and create my own installer. For example I want to make a license page with a read me on the installer. From what I understand the clickonce technology is what comes with express editions and you cannot do it with them. Is there an alternative to being able to accomplish what I want to do without having to purchase the full version of visual studio?

View 7 Replies

Saving Streamwriter In Two Seperate Locations

Jun 11, 2011

Greetings,

My app saves a bunch of stuff to an XML file. This is my line of code-
Using writer As XmlWriter = XmlWriter.Create("C:vdx2kMWSREEXTReportsInboxTK" & frmCitation.txtCiteNumber.Text & "Traff.xml", settings)

So that saves it at that specific location.

I need to duplicate the XML and have it also save in another location. I've been at this for days, Googling, searching, trying different things and now I need to turn here for help.

Any ideas?

View 2 Replies

Show Some Forms But Want Them To Appear On Specific Locations?

Sep 27, 2010

I want to show some forms but I want them to appear on specific locations . The problem is I don't know how to specify the coordinates . Using :

frm.Location = "0,0"
or
frm.Location = (0,0)

tell what is the correct syntax ?

And more thing : when a form is maximized or minimized , it looks like "flying" upwards or downwards . Is it possible to stop that visual efect ?

View 4 Replies







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