Visual BASIC .NET 2012
PART 24-filter using string or character search vb.net
Dr. GIRIJA NARASIMHAN 1
This slides are available http://slideshare.net /nbgirija
Dr. GIRIJA NARASIMHAN 2
This tutorial only for beginners , those
who don’t have any knowledge about
any programming language skill and
application design.
Dr.GIRIJA NARASIMHAN 3
Public Class Form1
Private Sub PharmaBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
Handles PharmaBindingNavigatorSaveItem.Click
Me.Validate()
Me.PharmaBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.GirijasetbDataSet)
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'GirijasetbDataSet.pharma' table. You can
move, or remove it, as needed.
Me.PharmaTableAdapter.Fill(Me.GirijasetbDataSet.pharma)
End Sub
'last record button
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
PharmaBindingSource.MoveLast()
End Sub
Dr.GIRIJA NARASIMHAN 4
'tax_price button
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If CostTextBox.Text > 5 Then
TextBox1.Text = Val(2)
TextBox2.Text = Val(CostTextBox.Text) + Val(TextBox1.Text)
Else
TextBox1.Text = Val(1)
TextBox2.Text = Val(CostTextBox.Text) + Val(TextBox1.Text)
End If
End Sub
Private Sub CostTextBox__leave(sender As Object, e As EventArgs) Handles
CostTextBox.TextChanged
Me.Validate()
Me.PharmaBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.GirijasetbDataSet)
End Sub
Dr.GIRIJA NARASIMHAN 5
'new button
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
PharmaBindingSource.AddNew()
End Sub
Private Sub BindingNavigatorMovePreviousItem_Click(sender As Object, e As
EventArgs) Handles BindingNavigatorMovePreviousItem.Click
End Sub
'update button
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Me.Validate()
Me.PharmaBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.GirijasetbDataSet)
End Sub
Dr.GIRIJA NARASIMHAN 6
'find button
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
PharmaBindingSource.Filter = "COST <' " & 4 & " ' "
End Sub
'string search button
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
PharmaBindingSource.Filter = "pharma_name like '" & TextBox3.Text & "*'"
End Sub
End Class
Dr.GIRIJA NARASIMHAN 7
Dr.GIRIJA NARASIMHAN 8
Public Class Form2
Private Sub PharmaBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
Handles PharmaBindingNavigatorSaveItem.Click
Me.Validate()
Me.PharmaBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.GirijasetbDataSet)
End Sub
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'GirijasetbDataSet.pharma' table. You can
move, or remove it, as needed.
Me.PharmaTableAdapter.Fill(Me.GirijasetbDataSet.pharma)
End Sub
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles
TextBox1.TextChanged
PharmaBindingSource.Filter = "pharma_name like '" & TextBox1.Text & "*'"
End Sub
End Class
Dr.GIRIJA NARASIMHAN 9

Part24 filter using string or char search in vb.net

  • 1.
    Visual BASIC .NET2012 PART 24-filter using string or character search vb.net Dr. GIRIJA NARASIMHAN 1 This slides are available http://slideshare.net /nbgirija
  • 2.
    Dr. GIRIJA NARASIMHAN2 This tutorial only for beginners , those who don’t have any knowledge about any programming language skill and application design.
  • 3.
    Dr.GIRIJA NARASIMHAN 3 PublicClass Form1 Private Sub PharmaBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles PharmaBindingNavigatorSaveItem.Click Me.Validate() Me.PharmaBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.GirijasetbDataSet) End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'GirijasetbDataSet.pharma' table. You can move, or remove it, as needed. Me.PharmaTableAdapter.Fill(Me.GirijasetbDataSet.pharma) End Sub 'last record button Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click PharmaBindingSource.MoveLast() End Sub
  • 4.
    Dr.GIRIJA NARASIMHAN 4 'tax_pricebutton Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click If CostTextBox.Text > 5 Then TextBox1.Text = Val(2) TextBox2.Text = Val(CostTextBox.Text) + Val(TextBox1.Text) Else TextBox1.Text = Val(1) TextBox2.Text = Val(CostTextBox.Text) + Val(TextBox1.Text) End If End Sub Private Sub CostTextBox__leave(sender As Object, e As EventArgs) Handles CostTextBox.TextChanged Me.Validate() Me.PharmaBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.GirijasetbDataSet) End Sub
  • 5.
    Dr.GIRIJA NARASIMHAN 5 'newbutton Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click PharmaBindingSource.AddNew() End Sub Private Sub BindingNavigatorMovePreviousItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorMovePreviousItem.Click End Sub 'update button Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click Me.Validate() Me.PharmaBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.GirijasetbDataSet) End Sub
  • 6.
    Dr.GIRIJA NARASIMHAN 6 'findbutton Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click PharmaBindingSource.Filter = "COST <' " & 4 & " ' " End Sub 'string search button Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click PharmaBindingSource.Filter = "pharma_name like '" & TextBox3.Text & "*'" End Sub End Class
  • 7.
  • 8.
    Dr.GIRIJA NARASIMHAN 8 PublicClass Form2 Private Sub PharmaBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles PharmaBindingNavigatorSaveItem.Click Me.Validate() Me.PharmaBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.GirijasetbDataSet) End Sub Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'GirijasetbDataSet.pharma' table. You can move, or remove it, as needed. Me.PharmaTableAdapter.Fill(Me.GirijasetbDataSet.pharma) End Sub Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged PharmaBindingSource.Filter = "pharma_name like '" & TextBox1.Text & "*'" End Sub End Class
  • 9.