.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 2nd, 2004, 10:03 AM
naim1970 naim1970 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 naim1970 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation Dynamic Listview

Hi,
I see that a lot of experts are able to answer of many questions in this site.
I try to make a dynamic Listview and I have a small problem with For Each xxx.


My problem is to push the data in dynamic way.
Every worker(string) has a directory with 12 files all months.
My wish is to take the information’s from those 12 files without erasing of data form the first worker, the code that I wrote erase every time the data from other worker and it keeps only from the last one.




Private Sub entreprises(ByVal word As String)

Dim worker As String


Dim Temp As New FileStream(Application.StartupPath & "\Save\test.txt", FileMode.Open) 'take information’s from file test.txt

Dim Temp_Stream As New StreamReader(Temp)

'

Do Until Temp_Stream.Peek = -1

Val = Temp_Stream.ReadLine.Split("|") 'Separator between the names

For i = 1 To Val.Length - 1



worker = Val(i - 1) 'One feet back if it goes to the end

Next '

Loop '

Temp_Stream.Close() 'Fermeture du fichier

Temp.Close() 'Fermeture du fichier



Dim objAccount As AccountsClassLibrary.Account
Dim objcont As AccountsClassLibrary.Account

If m_Accounts.Count = 0 Then

objAccount = New AccountsClassLibrary.Account

objAccount.AccountName = "Janvier"

Dim Fs_Janvier As New IO.FileStream(Application.StartupPath & "\Save\" & worker & "\Janvier.hor1", FileMode.Open)

Dim Str_Janvier As New IO.StreamReader(Fs_Janvier)
Do Until Str_Janvier.Peek = -1
Val = Str_Janvier.ReadLine.Split("|")

If Val(2) = word Then

objAccount.CodeListings.Add(Val(0), Val(1), Val(2), Val(3), Val(4))

'So here all data are erased by the last worker !!!

End If

Loop

m_Accounts.Add(objAccount) 'Add

Str_Janvier.Close()

Fs_Janvier.Close()



.

..

...



objAccount = New AccountsClassLibrary.Account
objAccount.AccountName = "Décembre"
Dim Fs_Février As New IO.FileStream(Application.StartupPath & "\Save\" & worker & "\Décembre.hor1", FileMode.Open)

Dim Str_Décembre As New IO.StreamReader(Fs_Décembre)
Do Until Str_Décembre.Peek = -1
Val = Str_Décembre.ReadLine.Split("|")
If Val(2) = word Then

objAccount.CodeListings.Add(Val(0), Val(1), Val(2), Val(3), Val(4))
End If

Loop

m_Accounts.Add(objAccount)



Str_Février.Close()

Fs_Février.Close()





Me.TabControl.TabPages.Clear()



For Each objAccount In m_Accounts

Dim objTabPage As New TabPage(objAccount.AccountName)

Dim objControl As New AccountsWindowsControlLibrary.UserControlAccounts

objTabPage.Controls.Add(objControl)

Me.TabControl.TabPages.Add(objTabPage)

With objControl

.Dock = DockStyle.Fill

.Account = objAccount

End With

Next



End If

End Sub



Thanks for you're help Naim

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > Dynamic Listview


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT