Copy List(Of T) Into An Independent List(of T)

Sep 23, 2009

I have to collection objects as follows Dim List1 As New List(Of clsTimesheet_Detail)
Dim List2 As New List(Of clsTimesheet_Detail) I have filled the List1 and now want to make an independent copy to the List2

[Code]...

View 4 Replies


ADVERTISEMENT

Create Local Copy Of A List To Be Able To Change Elements Only In New List?

Oct 26, 2011

This is probably a really basic question - but I have a list of items (custom objects) being passed from one winform (.net 3.5) to another. I want to create a local list to store changes that only get persisted if the user clicks save. Currently if the user clicks cancel - the changes are still applied in the first form because I assume the objects are reference type.I have the save working as it calls a service layer to do the save and then refreshes the other form - but not the cancel.

View 1 Replies

Copy Part Of A List?

Sep 18, 2009

I have a data structure like this :- myvar.mylistdata where mylistdata is of type list (of list (othertype)).

I want to then move the elements of a specified sub list to another list of list var like tmpvar.mylistdata, so i have been trying code like this[code]...

View 5 Replies

Checked List Box And Folder Copy?

Mar 1, 2012

I am trying to display contents of a remote share and based on selections in a checked list box copy only the selected folders to a local folder.

I can dsiplay the folders in teh checked list box fine, also can copy a folder no problem but now I want to do it based on the selections in the list box.

[Code]...

View 12 Replies

Copy Files From A List In Excel?

Oct 15, 2011

I am using visual studio 2008 (vb.net). I have a long list of file names in column A on an excel sheet. These files are located in a directory on my network drive. I have to copy these files over to another folder. I know how to copy files in vb.net, however, I need to copy the files listed on column A. (example: column A has - 453245435.tif, 43453345.tif, american justice.tif etc....)

[Code]...

View 19 Replies

Copy Files From A List Of Filenames?

Apr 9, 2011

I am sure this is a simple question to the more advanced, however, to the less advanced I am having a problem. I have to come up with a quick program (that works) for my job (I am a systems admin) that will either look in a database or excel sheet (which ever is easier) and find copy files from one directory to another. I know how to move, copy and delete, however, I need it to look for the specific filename.

[Code]...

View 5 Replies

Copy Linq Query To List?

Sep 12, 2011

'Read RESX file and returns a List(Of ResXDataNode)[code]...

Provide two separate copies of the node? Or will the List and Linq query still be referencing the same data?

View 2 Replies

ExecCommands List To Add The Copy Or Cut Features

Mar 20, 2009

I am making my own custom tabbed browser and now i want the ExecCommands list. to add the copy or cut etc features.

View 5 Replies

IDE :: List All Options Or Copy In An Array?

Feb 8, 2009

I am using namespace my. settings to save my options.How can I list all options or copy in an array?

View 3 Replies

Copy A List To Store Original Values To Be Used Later?

May 24, 2012

I have a WPF form that takes a list of objects that have locations and sizes and plots them on the canvas. I'm currently trying to implement an undo button that will throw out all the changes that have been made to the positions of the objects and revert back to the original collection that was retrieved when the form loaded.

As it stands now I go out to the database on the load of the form and get all the objects that will need to be displayed then assign the list that is returned to two seperate collections. The problem that comes up is that the two collections are actually pointers to the original collection and whenever one is changed the changes are reflected in the second collection.

Is it possible to copy a list of objects so that changes made to one collection won't affect the secondary collection?

So far I've tried simply using the assignment operator, passing the source collection into a function byval and scrolling through each element of the list manually adding it to the second collection and using linq to get all the objects from the original list and pushing the results to a separate temporary list and assigning the second collection to the temporary list.

I feel like I'm overcomplicating the issue but almost all the places I've come across while googling say that this behavior is by design, which I understand but it seems like this would be a fairly common idea.

View 3 Replies

Copy Contents Of A List Box To A Text File?

Apr 21, 2010

I understand I've been asking alot of similar questions around this topic, but I think, with luck, and your help, this will be the last time.

I have a listbox containing x-many different values.

What I want the program to do is to overwrite a pre existing file with all these values,

that is, essentially, to do the reverse of this piece of [code]...

View 4 Replies

Copy Files From List In Excel And Rename?

Oct 18, 2011

I have a program that I have been creating for work, however, I am down to the last part and can't figure it out......The code below copies files from one directory to another from a list of file names in the first column of an excel sheet. This part works fine. What I am trying to figure out is how can I have a prefix in column B where it renames the file while being copied to the destination folder?

Example:

Column A
book1.tif
book2.tif
book3.tif

[code]....

View 3 Replies

Copy List Of Structures To Excel Range?

Jan 6, 2011

Does anyone know how to copy a VB.Net list of structures to an Excel range? It's not hard to do with an array, but I can't get a list of structures to work.xample:

Structure MyStruct
Dim MyField1 as String
Dim MyField2 as Integer

[code].....

View 1 Replies

Deep Copy Generic List Of Classes

Aug 15, 2006

If I have a generic.list(of ClassA), is there a simple way to create a deep copy of this list that will not affect the original copy? It seems to work if I have a generic list of Structures, but for some reason the copy constructor for lists of classes only copies pointers to the elements (or maybe a pointer to the whole list?). I would move to structures if it were not for the fact that I can't find a way to edit the members in the structs in the list. eg:list(0).a = 5 'Does not workIs there some way to get around this without declaring an instance of that structure, like this:dim str as StructA = list(0)str.a = 5I'd

View 2 Replies

Transform Or Copy An Array To A Linked List?

Jul 2, 2010

I need to copy an array to a linked list OR transform the array in a linked list.How this can be done in .NET (C# or VB)?

View 3 Replies

Copy List Object To Another List Object

Jun 15, 2012

I am having a problem when setting VB.NET list object to another.I create an instance on ReadLocations and than create an object of ReadLocation where then I loop through ReadLocations and set ReadLocation1 equal to rl. What happens is that if I then go and change ReadLocation1 to something else (assdfhsd) it will also change the ReadLocations index. I am really confused why it would be doing that unless it is "=" sign means referencing instead of actually setting the value. Please help as I am a C# developer but the program I am modifying is in VB.NET.[code]

View 1 Replies

Generate A List That Can Copy And Then Paste Into A Word Document

Apr 6, 2012

I need to generate a list that I can copy and then paste into a Word Document. I tried using a listbox, but I couldn't copy from that. Basically I don't want to have to type 200 different numbers and I thought this would be quick and easy to write, but I'm stumped. I need the list to be generated in this fashion and it would also be nice if it was all in one line:

[Code]...

View 3 Replies

Loop Through An Array Of Byte And Copy The Contents To A New List?

Oct 3, 2011

I'm trying to loop through an array of byte and copy the contents to a new list of bytes, and display them back. see the code below.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myByte() As Byte = New Byte() {65, 66, 67}

[Code]....

I want to see str1 as "ABC" but the out put i get is "A B C" (ie with spaces between letters) note: I have to copy(chunks) within a loop and get the result at the end, this is just a sample to reproduce my real issue.

View 2 Replies

VS 2008 Mdiwindowlistitem Dropdownlist - Copy Items And Add Back To List After Refresh

Jun 16, 2009

In my project when someone logs in I refresh the overhead and side menus. My overhead menu is an extended menustrip component that I have made. I am able to clear the menu, reload it dynamically but I am not able to add/insert the open windows which are managed by the mdiwindowlistitem property. These are the items named "1 - form name " "2 - form name" etc.

I have been able to copy the whole dropdown list, and with some very hacky loop work I can take out everything but the items related to the forms. But when I add them back in, they are not on my list. The related forms are still open and if you click the maximize button to shrink a open child window, and then re-maximize that same window...the items magically show up in the list.

This ManageMenus sub is called during a login change. If you breakpoint on "openwindowslist" after it is returned with data, it has the proper entries and nothing extra. It just seems that the for/each add loop does not actually add the items. Or, if it does add them, I can't see them.

Tried both insert and add functions, same results both ways.

CODE:

In my xmlMenuStrip component this is the function that removes everything but what follows the seperator. It returns them in a list.

The format of the full window menu is:

CODE:

View 4 Replies

VS 2010 Sorting A Listbox (after Trying To Copy Class Instances Properties To A Temp List)

Jan 25, 2012

I'm trying to figure out a way to sort the entries of a listbox... but in a different way instead of the obvious one (sorted property). First of all, I need to explain how the items are populated at first:

[Code]...

View 19 Replies

Create A Toggle Button That Switches A List To A Range And Then Back To A List If Needed?

May 14, 2009

II am trying to create a toggle button that switches a list to a range and then back to a list if needed. I am able to get it to do both but when I add an item to the list, convert to a range and then convert back to a list it leaves off the last items I entered.I tried to work in a code to select all cells but I must not be putting it in the right place.This is what I have so far:

ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$3:$AE$7"), , xlYes).Name = _
"List1"

I realize the problem is the $AE$7 (the $A$3 is correct)

View 1 Replies

DB/Reporting :: ODBC To SQL Server 8 Shows List Of Procedures But Not List Of Tables Or Views?

Oct 27, 2009

In VS 2008, VB.Net, I am successful connecting to a local SQL Server (version 8) and seeing all tables/views/procedures in Server Explorer. The local OS is Win XP Pro SP3. I created an ODBC data source to a remote SQL server (also version 8) with a database of the same structure as the local one. The connection tests out ok. The remote computer runs Windows Server 2000 SP4. In the VS 2008 Server Explorer I add this ODBC source. When I click on the plus-signs to expand items, neither the tables nor the views show anything, whereas the full list of procedures appears. Is it the old SQL Server version? Is it the old Server OS version? Something else alltogether?

View 2 Replies

VS 2008 Student List Views - List Boxes And Data Fro Access DB Tables

Dec 30, 2010

This is what I'm sure will be the first of many noob-ish questions from yours truly... I'm studying as a mature student for a Computing Degree (encompassing web design, hardware, programming and systems analysis). The programming seems to be my weak spot this year. I enjoyed C++ last year, doing basic console applications, but progamming visually with VB in Visual Studio 2008 I'm struggling!

[Code].....

View 12 Replies

C# - WCF Serialization And Interfaces - Error: List(of Object) Cannot Be Converted To List(of IMyInterface)

Oct 16, 2009

Does link text mean I have to return a concrete implementation? Even though I am using svcutil with the /r that includes my entites(where IMyInterface is defined). I get no errors but it changes all List(of IMyInterface) to list(of Object) and I cannot deserialize it on the client

Error: list(of object) cannot be converted to list(of IMyInterface).

View 1 Replies

Determine If Property Is Generic List<of T> Via Reflection And Loop List Items

Oct 1, 2009

I'm looping all the properties in an object via reflection:

For Each p As PropertyInfo In values.[GetType]().GetProperties()
If p.CanRead Then
'Do stuff
End If
Next

how to determine whether the property in question is a generic List(Of T)? If it is I need to loop the list itself.

I've experimented with GetType and TypeOf but have not managed to get anything working.

To clarify, I want to keep this generic. I do not want to specify the type of T, I need to loop the list items and call the ToString method on each item. T could be one of a number of different types (application specific reference types). Is it possible to do this without specifying types?

(VB.NET 2005 with .Net 2.0)

View 3 Replies

Generate A List Of Random Integer With A Click Of The Button And Put The Results In A List Box Using .Net?

Nov 18, 2009

If I can generate a list of random integer with a click of the button and put the results in a list box using VB.Net but how do I randomly change several integer number generated by button 1 by clicking button 2? How I retain the results of button1 and change the results when clicking button2?I try before but the two button function code cannot relate to one another.

View 1 Replies

Get Type Of Derived Generic List Class From List Item Method?

Mar 23, 2011

Public Class notifierMain
Public Class Contacts
Inherits List(Of row)
Public Sub New()

[code]....

When I debug this winforms application I get curType = "notifier.notifierMain+Contacts+row" I want to the Validate function to know it is in MyContacts. How do I do this?

View 3 Replies

IDE :: ODBC To SQL Server Shows List Of Procedures But Not List Of Tables Or Views?

Oct 27, 2009

In VS 2008, VB.Net, I am successful connecting to a local SQL Server and seeing all tables/views/procedures.I created an ODBC data source to a remote SQL server with a database of the same structure as the local one.The connection tests out ok. In the VS 2008 Server Explorer I add this source. When I click on the plus-signs to expand items, neither the tables nor the views show anything, whereas the full list of procedures appears.How can I see the lists of tables and views in Server Explorer for an ODBC source?

View 1 Replies

Make A Project Where A Teacher Views A List Box With A List Of Students Of A Class?

Nov 5, 2011

I wish to make a project where a teacher views a list box with a list of students of a class. When he selects a name from the first list box the second listbox would change its data to show the grades for that one student.

View 10 Replies

Passing List (Of ChildClass) As Parameter To Method Expecting List (Of ParentClass)?

Apr 12, 2010

I have implemented inheritance for two parent classes called Table and Field. Each parent class has several child classes. In the Table parent class, I created a method that expects parameter List(Of Field).

I get an error when trying to pass in parameter List(Of ChildField) to the method that expects a parameter of List(Of Field). The error message is as below:

Value of type
'System.Collections.Generic.List(Of
com.hlb.icisbatch.data.ChildField)'

[Code]....

View 2 Replies







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