Click here to Skip to main content
15,880,503 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generalupdating database using dataset..help! Pin
obrix_activex9-Nov-04 0:12
obrix_activex9-Nov-04 0:12 
GeneralRe: updating database using dataset..help! Pin
ccotton33324-Nov-04 7:52
ccotton33324-Nov-04 7:52 
GeneralPrinting w/out Crystal Report in VBNet Pin
reyboy8-Nov-04 22:44
reyboy8-Nov-04 22:44 
GeneralRe: Printing w/out Crystal Report in VBNet Pin
Tom John9-Nov-04 5:55
Tom John9-Nov-04 5:55 
QuestionHow to get domain name of specific computer? Pin
dungle308-Nov-04 20:42
dungle308-Nov-04 20:42 
Questionhow to change datagrid properties? Pin
Lisana8-Nov-04 19:43
Lisana8-Nov-04 19:43 
QuestionHow to add dataset values to Crystal Report fields Pin
Jeevan anjna8-Nov-04 19:42
Jeevan anjna8-Nov-04 19:42 
GeneralThread Problem Pin
Sumit Domyan8-Nov-04 18:14
Sumit Domyan8-Nov-04 18:14 
I am working on file based Messenger application (using VB.NET) in which i m using a Web Service where all my application functions are written. I have a list of users which i m desplaying in a treeview & refreshing this list every 5 seconds. I call a function from web service to get the latest list of online users. But i want to run this process in background using threads. But i m not able to do this.

Code is:
----------------------------------------------------------------------------
Private populate_userlist_thread As Threading.Thread
Private Sub RefreshUserList()

'This is my main function, here i m calling another function using thread.

populate_userlist_thread = New Threading.Thread(AddressOf PopulateUsers)
populate_userlist_thread.Start()

End Sub


'Here is the delegate
Delegate Sub GeneralDelegate()
Private invoker As GeneralDelegate

Private Sub PopulateUsers()
Dim msngr_serv_obj As MessengerService.MessengerFunctions
Dim users_dataset As DataSet
Dim i As Int32
Dim curr_node As TreeNode
Dim tree_node_collection As TreeNodeCollection


msngr_serv_obj = New MessengerService.MessengerFunctions
users_dataset = msngr_serv_obj.GetOnlineUsers

UsersTreeView.Nodes.Clear()

For i = 0 To users_dataset.Tables(0).Rows.Count - 1
If UsersTreeView.InvokeRequired = True Then
invoker = New GeneralDelegate(AddressOf RefreshUserList)
UsersTreeView.Invoke(invoker)
End If
curr_node = UsersTreeView.Nodes.Add(users_dataset.Tables(0).Rows(i).Item(0).ToString)
curr_node.ForeColor = Color.Green
Next
End Sub

----------------------------------------------------------------------------

But this code is not working fine. Can anybody plz help me. Or do u have any other solution to this problem.

Thanks

Sumit Domyan
Software Developer
ANALEC INFOTECH
GeneralRe: Thread Problem Pin
Fade (Amit BS)10-Nov-04 16:31
Fade (Amit BS)10-Nov-04 16:31 
GeneralRe: Thread Problem Pin
Sumit Domyan10-Nov-04 18:10
Sumit Domyan10-Nov-04 18:10 
GeneralRe: Thread Problem Pin
Fade (Amit BS)13-Nov-04 22:30
Fade (Amit BS)13-Nov-04 22:30 
GeneralCapture an HTML document as an image Pin
ddd ssss8-Nov-04 17:52
ddd ssss8-Nov-04 17:52 
GeneralDisplay non duplicate data in combobox Pin
CelesterMok8-Nov-04 15:22
CelesterMok8-Nov-04 15:22 
GeneralQuestions Pin
Tech 4 a dummy8-Nov-04 14:57
Tech 4 a dummy8-Nov-04 14:57 
GeneralRe: Questions Pin
Tom John9-Nov-04 3:08
Tom John9-Nov-04 3:08 
GeneralRe: Questions Pin
Tech 4 a dummy9-Nov-04 13:44
Tech 4 a dummy9-Nov-04 13:44 
GeneralRe: Questions Pin
Tom John9-Nov-04 22:25
Tom John9-Nov-04 22:25 
GeneralToolbar button images not being diplayed Pin
Verolix8-Nov-04 13:16
Verolix8-Nov-04 13:16 
GeneralDisabling combobox items... Pin
Tim8w8-Nov-04 12:28
Tim8w8-Nov-04 12:28 
GeneralRe: Disabling combobox items... Pin
Dave Kreskowiak8-Nov-04 17:53
mveDave Kreskowiak8-Nov-04 17:53 
GeneralRe: Disabling combobox items... Pin
Tom John9-Nov-04 7:36
Tom John9-Nov-04 7:36 
GeneralVery simple question Pin
Boniolopez8-Nov-04 12:15
Boniolopez8-Nov-04 12:15 
GeneralRe: Very simple question Pin
beowulfagate8-Nov-04 13:17
beowulfagate8-Nov-04 13:17 
GeneralRe: Very simple question Pin
axiomillies14-Nov-04 19:16
axiomillies14-Nov-04 19:16 
GeneralConvert Sprite Sheets to Animations Pin
maykut20998-Nov-04 12:05
maykut20998-Nov-04 12:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.