Looping A Collection Into Multiple New Filenames - How To Speed Up

Apr 6, 2010

i have the following snippet of

For Each tempstring In SourceDataCollection
LineToFieldsTemp = Split(tempstring, ",")
LineStringWithoutFirstEntry = "" 'reset the linestring
For i = 1 To UBound(LineToFieldsTemp)

[code]....

essentially what i'm doing is to read through each item in a collection of comma separated variable strings. the first variable in each string is appended to a master filename and becomes the NEW filename to which the entire string will be appended. this is a way to split a CSV file into multiple files using the first variable in that string.

the trouble is that this is doing a LOT of writes to potentially a LOT of files, the IO is taking forever. is there a way to buffer this data until the end, then write it to a disk? be aware, the filenames and total number of files to be created is UNKNOWN at the begining of the loop. it just creates a new file each time a unique first column ID is discovered.

View 13 Replies


ADVERTISEMENT

Speed Up Looping Through A Dictionary

May 17, 2011

I have a process that imports a daily file of product registrations, and adds them into our database. Originally this process would query against the database multiple times for each record to determine how to process the data.In order to speed up this process and prevent any timeout issues that could appear to people trying to use a reporting site that uses the same database, I've changed the code to pull down a few of the tables into dictionaries, and then iterate across them to see if that customer/address/dealership exists, and pull the Id from the key of the dictionary if it does, or insert it into the table and then the dictionary if it doesn't.However, I'm currently finding this to be running slower than if I were querying the database multiple times for each registration. One possible cause that I can think of is that my dictionaries are quite large (one has 8 million entries and another has 11 million).[code]

View 5 Replies

Importing Multiple Filenames Into A Listbox?

Mar 21, 2010

I have a program in which I need the user to be able to import multiple image filenames into a listbox. Here is my

vb.net
Private Sub ImagesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ImagesToolStripMenuItem.Click
Dim import As New OpenFileDialog

[Code].....

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

VS 2008 : Looping Regex Match Collection?

Jan 3, 2010

I have my regex setup, which works prefectly:

vb.net
Dim testStr As String = "<option value=""18621335"">graham23s</option>"
Dim rx As New Regex("<option value=""(d+)"">(.+?)</option>")

[code]....

When i put it into my own application i have done:

vb.net
Dim stringSource As New Regex("<optionvalue=""(d+)"">(.+?)</option>", RegexOptions.IgnoreCase Or RegexOptions.Singleline)
Dim stringMatches As MatchCollection = stringSource.Matches(stringCle

[code]....

what i am having trouble with is getting the values while in the foreach loop.

View 3 Replies

Looping Though A List Or Collection Of Controls Available In The Development Enviroment?

Apr 12, 2009

How can I find a List or Collection of User Controls available within the development enviroment and dynamically add them to a combox by their Name Property. I am looking for something along the lines of:

View 4 Replies

Reset IIS On Multiple Servers At Once Instead Of Looping Through?

Feb 24, 2009

I am trying to reset IIS on a set of servers all at one time instead of looping through and resetting each one individually, but I can't seem to figure out how to do it.[code]...

View 4 Replies

How To Increase Speed Of A Data Entry Application Used By Multiple Users

Mar 15, 2012

We are four in a team using a data entry application created using VB and MS Access as backend DB. The application is installed on all our PCs, but uses my PC as server. We enter data at same time. The application has been slow since we started using it. We were advised to increase the internet bandwidth, which we doubled, but the application is still slow. What can be done to increase the speed of the application to make work move faster?

View 1 Replies

Threading: Multiple Looping Threads Where They're Guaranteed To Run?

Jul 12, 2011

When the program starts, it checks for the amount of threads the user wants to use to download files with. The threads are then created. When the user chooses a file to download, the threads begin grabbing the file until it's fully downloaded.The problem is, some threads stall right from the start, & just sit there doing nothing.The global work variable is Sync-Locked, then quickly released by each instance, & to my eyes, there is nothing wrong.They are all instances of the same class, & do the exact same thing, so why is it that some run, & others don't?VB.NET is the programming language. They are looping Background workers.I would really like to know why some run, & others don't.btw... they have quick non-blocking sleeps, as well as blocking sleeps to allow others the chance to run (proprietary non-blocking DLL).So all i'm left to think on is that Microsoft's process queuing has some type of bug going on in there someplace....or is there a way to do multiple looping threads where they're guaranteed to run?

View 2 Replies

Looping Code Is Adding Values Multiple Times?

Feb 17, 2011

Looping code is adding my values multiple times

View 4 Replies

Check Internet Speed - Download A File Like 1mb Size, Then It Will Calculate The Speed?

Feb 21, 2012

How do i exactly check internet connection speed.I have searched around google and found out a method w/c will Download a file like 1mb size, then it will calculate the speed.

View 1 Replies

Check The Bandwidth (download Speed And Upload Speed) Of A User In .net Or Php?

Dec 31, 2010

how do i check the bandwidth (download speed and possible upload speed) of a user in vb.net or php that uses my app or visits my site resp?

View 1 Replies

VS 2010 Calculate DownLoad Speed And UpLoad Speed Kb/s And Graph

Nov 30, 2010

I have a codes that calculates DownLoad speed and UpLoad speed kb/s. I would like to implement this kind. I also want to put such kind of graph. Any article or links where can I start building my own like that.

View 2 Replies

Simple Looping - Create Multiple Form Fields For Each Entry In Underlying Database Table

Nov 24, 2009

I am trying to create a form which will be fed by an underlying database to create multiple form fields for each entry in an underlying database table. This is for a program to monitor patients under anesthesia, and prior to surgery, the doctor will choose which monitors they will be using. Then, on the actual monitor screen which will pop up every X minutes, there will be a text box and a check box for each chosen monitor. I am relatively new to VB, so I have tried to illustrate what I am needing but using the logic that I know from my previous life in PHP.

I am using DevExpress's layout control to place the form fields, so that is the code in the middle of the first loop (on_load), and I know that part works, I just need to know how to name the fields and then recover those fields and commit the values to the database. (the text boxes are added to the database, the check boxes are used to determine if an entry is made for that monitor- i.e. at the end of surgery if a monitor is turned off). I know that my syntax for naming the fields is no where close to correct, and it probably would not work in PHP, but I remember doing something like this in a PHP application I built long ago. [Code]

View 3 Replies

Calculate Internet Download Speed And Upload Speed

Jul 29, 2009

i want to monitor the speed at which my system is currently Downloading and uploading. I dont have any idea how will it can be done.

View 6 Replies

Multiple Properties In A Collection

Aug 10, 2010

I want to create a collection with multiple properties.

View 15 Replies

Multiple ComboBoxes Using Same Collection For DataSource

Apr 21, 2009

I have two combo boxesthat use the same collection for their datasource. The data member and value member are also the same properties. When the form loads, and I select an item in one of the combo boxes, the same item is then selected in the other combo box. I want the combo boxes to work separately. Do I need to have two different collections, even though they would have the same data in them?

cboInboardKnife.DataSource = cKnives
cboInboardKnife.DisplayMember =
"Name"
cboInboardKnife.ValueMember =
"ToolID"
cboOutboardKnife.DataSource = cKnives
cboOutboardKnife.DisplayMember =
"Name"
cboOutboardKnife.ValueMember =
"ToolID"

View 1 Replies

Wpf - Add Multiple Classes To An Observable Collection?

Jan 30, 2012

I'm still teaching myself how to bind and use observable collection. One problem that I'm a little confused on is binding multiple classes/observable collection to one page. In other words, if I have a PersonName class and a AnimalName class, I have to create two separate observalbe collections for each? How would I set the datacontext when a page only allows one?

[code]...

Now If I add another class, how would I combine the two on the binding part and collection part.

View 2 Replies

Wpf - Multiple Views Of Observable Collection?

Mar 13, 2012

I've been working on this problem for a while and I'm clearly missing something...I create, populate and bind an observable collection like so:

Dim _ObservableWEI As New ObservableWEI
...
_ObservableWEI.Add(New WEI() With {.WEInum = 1, .WEIvalue = 1})[code].....

The problem is the filter effects the contents of both listboxes. I guess I need a specific instance of the collection to apply the filter too or something

View 1 Replies

Filtering A Collection With Linq And Multiple Criteria?

Jun 7, 2012

On my view there is a datatable holding a collection of ServerRow and 4 textboxes (Hostname, OS, Location, Zone). When the user types into any of the 4 boxes I want to immediately filter this list. I have this code setup and ready to go that on the set method of each textbox property I call the filter method.

Now onto the problem: if I have 4 criteria that means I have 2 to the power of 4 different scenarios. What I would like to do is write a linq statement with all of these scenarios dealt with such that if any of the properties are NullOrEmpty they will not be used in the Where clause and on the flip side if there is a value the corresponding field will be searched with a Contains.

Example

AvailableCis = New ObservableCollection(Of ServerRow)
(_CiData.Where(Function(ci) ci.OS.ToUpper
.Equals(_selectedOS.ToUpper) AndAlso
ci.HostName.ToUpper.Contains(_ciNameFilterText.ToUpper))
.OrderBy(Function(a) a.CiName))

This example shows how it works with 2 criteria and both of those criteria are set.

View 1 Replies

Check For The Lan Speed And Put This Speed Value In A Progress Bar?

Jan 4, 2012

i want to check for the lan speed and put this speed value in a progress bar.

for example:

[==== ] the lan speed now is 23 KB/s

and there is another problem is if there are a LAN and a WiFi adapter in the same time how do i check for the speed for both adapters

View 1 Replies

Sync Locks - Manage Access To A Collection Object From Multiple Threads - Add, Update, Remove, Clear

Oct 20, 2009

I am considering a piece of code that will manage access to a collection object from multiple threads - add, update, remove, clear. OK ... so I have put a sync lock within each method, but what is not clear from the MS documentation is exactly how the sync lock is behaving. Is it locking the piece of code it wraps? Or is it locking the object? And if it is locking the object a private static object should lock out any code locked on the object within all instances of the object? i.e. if an add operation is underway, an update, delete or clear will wait for the lock to be released.

Finally, if I have multiple threads contending for the sync lock, how is the release managed? First come, first serve? random (from my p.o.v)? Is there a chance that two separate threads could blunder into 'locked' code simulataneously?

View 2 Replies

Get The Speed Of A Computers Fan Speed?

May 5, 2009

how would i go about getting the of a fan of a computer that my program is running on in rps(revolutions per second) using vb.net?

View 4 Replies

.net - Multiple "= New" With The Same Variable - Does Garbage Collection Dispose

Jul 30, 2009

Dim x as whatever
Try
x = new whatever(1)
something is done with x

[code]....

What happens to x = whatever(1)Does garbage collection find the pointer to the first new and destroy it or what?

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

Drag And Drop Filenames Into VB App

Nov 11, 2009

I'm a relative novice at coding in visual basic 2008 and am trying to implement dragging and dropping filenames from windows explorer into a listbox within my VB app. My customer wants to do this as opposed to selecting filenames from a directory browsing window.

View 3 Replies

Forms :: Getting A List Of FileNames?

Apr 22, 2009

I have this peice of code..

Private Sub OpenFileDialog2_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog2.FileOk
ListBox1.Items.Add(OpenFileDialog2.FileNames)

[Code].....

View 2 Replies

Get Filenames Case Insensitive?

Sep 9, 2011

I am using this code to get a list of files in a folder:

Dim files() As String = (From file In New IO.DirectoryInfo(myFolder).GetFiles Where file.Extension = ".exe" Select file.Name).ToArray

This works fine, but the problem is that it selects only files with the extension of "exe" & skips files that have an "EXE" extension. Is there any way to make it case-insensitive, to make it return any combination of upper/lower case letters in the extension?

View 2 Replies

Get Filenames From Opendialogform In A String

Oct 25, 2011

How can i get all the filnames in array as a string? [code]

View 1 Replies







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