venkii R

venkii R

  • NA
  • 13
  • 18.3k

Send values from Class file to VB form in vb.net windows application 2005

May 2 2011 3:41 AM
Hi All,
Currently i am working on Windows Application in VB.NET. i have 10 class files. so i created induvidual classes. only 1 main vb form and it's have some lables. i pass dataset to class file and maipulation will done in class file.

Main form:

If State = "AP" Then
gAP_State.AssignRules(gDsData)
ElseIf State = "MH" Then
gMHState.AssignRules(gDsData)
ElseIf State = "MP" Then
gMPState.AssignRules(gDsData)
ElseIf State = "KA" Then
gKAState.AssignRules(gDsData)
End If

Class File: gMHState

Public Function AssignRules(ByVal gDsData As DataSet) As Boolean

For i = 0 To gDsData.Tables(0).Rows.Count - 1

Dim chlForm As New Extraction_Main

chlForm.lblExtractedCount.Text = gDsData.Tables(0).Rows.Count

chlForm.lblStateIdValue.Text = gDsData.Tables(0).Rows(i)(StateID).ToString()

End Function

from the above code in main form i have Dataset. i need to pass this to class file and iterate it and Assign some rules and save in DB. in this class file i created Main form object and i needs to show in main form Lable. same way needs to show the StateID which is processed currently in StateID Lable. if dataset having 10 rows then my StateID lable in main form will show the 10 Ids 1 by 1 based on transaction.

but from my above code its not shown corresponding values in Main form lables.

Can any one plz send the code or give the idea how can i achive this.?

Awaiting for response.

Regards,
Venky



Answers (2)