Click here to Skip to main content
15,911,360 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
Private Sub BtnFind_Click(sender As Object, e As EventArgs) Handles BtnFind.Click
   Dim id As Integer
   con = New SqlConnection("Data Source=.;Initial Catalog=Church_Management_System;
   Integrated Security=True")
   con.Open()
   id = Val(InputBox("Enter Membership ID", "FIND MEMBER"))
   sqlstr = "SELECT Membership_Id, tithe_Id, FName, MName, LName, DoB, 
   Gender,Occupation, Place_of_Birth, Baptised, Communicant, statuss, Marital_Status,   
   Bio, country, addresss, Town, Phone, work_phone, Mobile, email, pic, FROM MEMBERSHIP 
   WHERE MEMBERSHIP_ID='" & Membership_IdTextBox.Text & "'"
   cmd = New SqlCommand(sqlstr, con)
   dr = cmd.ExecuteReader

   If dr.HasRows = True Then
       While dr.Read()
           Membership_IdTextBox.Text = dr(0)
           Tithe_IdTextBox.Text = dr(1)
           FNameTextBox.Text = dr(2)
           MNameTextBox.Text = dr(3)
           LNameTextBox.Text = dr(4)
           DoBDateTimePicker.Value = dr(5)
           GenderComboBox.SelectedItem = dr(6)
           OccupationTextBox.Text = dr(7)
           Place_of_BirthTextBox.Text = dr(8)
           BaptisedCheckBox.Checked = dr(9)
           CommunicantCheckBox.Checked = dr(10)
           StatussCheckBox.Checked = dr(11)
           Marital_StatusComboBox.SelectedItem = dr(12)
           BioTextBox.Text = dr(13)
           CountryComboBox.SelectedItem = dr(14)
           AddresssTextBox.Text = dr(15)
           TownTextBox.Text = dr(16)
           PhoneTextBox.Text = dr(17)
           Work_phoneTextBox.Text = dr(18)
           MobileTextBox.Text = dr(19)
           EmailTextBox.Text = dr(20)
           Pic.Image. = dr(21)
           Entry_dateDateTimePicker.Value = dr(22)

       End While
       MsgBox("Record Found")
   End If
Posted
Updated 11-May-14 16:28pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900