VB.NET

Moderators: seancampbell
Number of threads: 4022
Number of posts: 10035

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Search button help please!!!! Posted by jade1 on 18 Oct 2004 at 9:41 AM
Hi there
The coding for my project looks as follows.

Private MemberDetail1AL As New ArrayList
Private M01Member001Info As New MPF.PAS.Contributions.M01Member001Info
Private MemberConsInfoController As New PAS.Contributions.MemberConsInfoController



If txtRunNumber.Text <> "" Then
MemberDetail1AL = MemberConsInfoController.GetMemberInfo (txtRunNumber.Text)
dtgTest.DataSource = MemberDetail1AL
M01Member001Info = MemberDetail1AL.Item(0)
End If



'THESE ARE THE BINDINGS FOR Member Detail(M01/002/001)

txtIndustryNumber3.DataBindings.Add("Text",M01Member001Info, "IndustryReference")
txtIdentityNumber3.DataBindings.Add
("Text", M01Member001Info, "IDNumber")
txtDateOfBirth3.DataBindings.Add
("Text", M01Member001Info, "BirthDate")
txtSurname.DataBindings.Add
("Text", M01Member001Info, "Surname")
txtInitials.DataBindings.Add
("Text", M01Member001Info, "Initials")
txtFirstName1.DataBindings.Add
("Text", M01Member001Info, "FirstName1")
txtFirstName2.DataBindings.Add
("Text", M01Member001Info, "FirstName2")
txtFirstName3.DataBindings.Add
("Text", M01Member001Info, "FirstName3")
txtTitle.DataBindings.Add
("Text", M01Member001Info, "Title")
txtLanguage.DataBindings.Add
("Text", M01Member001Info, "Language")
txtGender.DataBindings.Add
("Text", M01Member001Info, "Gender")
txtMaritalStatus.DataBindings.Add
("Text", M01Member001Info, "MaritalStatus")
txtPassportNumber.DataBindings.Add
("Text", M01Member001Info, "PassportReference")
txtPopulationGroup.DataBindings.Add
("Text", M01Member001Info, "PopulationGroup")


I also have a txtRunNumber textbox and a Search button , now I would like it if i could enter my run number in this text box and when i click my search button it will return all the relevant values in the text boxes i have binded.Any suggestions as the if statement i have written doesnt really do the trick.Also how can i stop it form bombing out if lets say i enter a run number that does not exist.

Kind Regards.





Report
Re: Search button help please!!!! Posted by btseb on 20 Oct 2004 at 11:57 AM
: Hi there
: The coding for my project looks as follows.
:
: Private MemberDetail1AL As New ArrayList
: Private M01Member001Info As New MPF.PAS.Contributions.M01Member001Info
: Private MemberConsInfoController As New PAS.Contributions.MemberConsInfoController
:
:
:
: If txtRunNumber.Text <> "" Then
: MemberDetail1AL = MemberConsInfoController.GetMemberInfo (txtRunNumber.Text)
: dtgTest.DataSource = MemberDetail1AL
: M01Member001Info = MemberDetail1AL.Item(0)
: End If
:
:
:
: 'THESE ARE THE BINDINGS FOR Member Detail(M01/002/001)
:
: txtIndustryNumber3.DataBindings.Add("Text",M01Member001Info, "IndustryReference")
: txtIdentityNumber3.DataBindings.Add
: ("Text", M01Member001Info, "IDNumber")
: txtDateOfBirth3.DataBindings.Add
: ("Text", M01Member001Info, "BirthDate")
: txtSurname.DataBindings.Add
: ("Text", M01Member001Info, "Surname")
: txtInitials.DataBindings.Add
: ("Text", M01Member001Info, "Initials")
: txtFirstName1.DataBindings.Add
: ("Text", M01Member001Info, "FirstName1")
: txtFirstName2.DataBindings.Add
: ("Text", M01Member001Info, "FirstName2")
: txtFirstName3.DataBindings.Add
: ("Text", M01Member001Info, "FirstName3")
: txtTitle.DataBindings.Add
: ("Text", M01Member001Info, "Title")
: txtLanguage.DataBindings.Add
: ("Text", M01Member001Info, "Language")
: txtGender.DataBindings.Add
: ("Text", M01Member001Info, "Gender")
: txtMaritalStatus.DataBindings.Add
: ("Text", M01Member001Info, "MaritalStatus")
: txtPassportNumber.DataBindings.Add
: ("Text", M01Member001Info, "PassportReference")
: txtPopulationGroup.DataBindings.Add
: ("Text", M01Member001Info, "PopulationGroup")
:
:
: I also have a txtRunNumber textbox and a Search button , now I would like it if i could enter my run number in this text box and when i click my search button it will return all the relevant values in the text boxes i have binded.Any suggestions as the if statement i have written doesnt really do the trick.Also how can i stop it form bombing out if lets say i enter a run number that does not exist.
:
: Kind Regards.
:
:
:
:
:
:

Are you loading these from a record set? In your bindings are each of them seperate tables? (IDNumber, FirstName, etc) If not you normally need to refer to the table and specific field the control is bound to: Table.IDNumber, etc.

You can either put a Try / Catch on the button click to catch any errors or make your If txtRunNumber.Text <> "" Then a If/ Then / Else statement.




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.