The document discusses how to work with binding navigators and reports in VB.NET forms. It explains that to display a binding navigator, drag it from the toolbox onto the form design surface. The binding navigator must be configured to the appropriate table binding source to function properly at runtime. The document also provides steps for creating reports from databases in VB.NET, including designing the report layout with text boxes, tables, and columns and viewing the report using a report viewer control.
1. Part 3- Binding Navigator in
Form design vb.net
Dr. Girija Narasimhan 1
Watch this tutorial in the youtube link :
https://www.youtube.com/watch?v=_U8TMuhQ1JU
2. Suppose in the form design , Binding Navigator is not appear then go to view
tool box data Binding Navigator drag and place it in form design
Dr. Girija Narasimhan 2
3. In the Form Design Binding Navigator right click Property Binding source change
appropriate table binding source, then only in the runtime it is active otherwise it is inactive
in runtime. Only visible in design time
Dr. Girija Narasimhan 3
6. Dr. Girija Narasimhan 6
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
StudentDataGridView.Visible = True
StudentBindingSource.Filter = "internal > ' " & 30 & " ' "
End Sub
Search button
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
StudentDataGridView.Visible = True
StudentBindingSource.Filter = "sId = ' " & TextBox1.Text & " ' "
End Sub
Filter Button
8. Dr. Girija Narasimhan 8
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
StudentBindingSource.MoveFirst()
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
StudentBindingSource.MoveNext()
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
StudentBindingSource.MoveLast()
End Sub
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
StudentBindingSource.MovePrevious()
End Sub
9. Dr. Girija Narasimhan 9
Part 8- Add/update/delete
records using records
operation buttons
IN
VB.NET
10. Dr. Girija Narasimhan 10
ADDNEW Buttton
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
StudentBindingSource.AddNew()
End Sub
UPDATE Button
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
Dim ANS As String
ANS = InputBox("Sure to save changes done?")
If ANS = "y" Or ANS = "Y" Then
Me.Validate()
Me.StudentBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Part3DataSet)
End If
End Sub
11. Dr. Girija Narasimhan 11
Private Sub StudentDataGridView_RowLeave(sender As Object, e As
DataGridViewCellEventArgs) Handles StudentDataGridView.RowLeave
Me.Validate()
‘ Me.StudentBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Part3DataSet)
End Sub
Delete Button
Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
Dim ANS As String
ANS = InputBox("Sure to delete current record?")
If ANS = "y" Or ANS = "Y" Then
Me.Validate()
Me.StudentBindingSource.RemoveCurrent()
Me.TableAdapterManager.UpdateAll(Me.Part3DataSet)
MessageBox.Show("Record delete sucessfully")
End If
End Sub
ADDNEW not save the new record information in the table so, this coding is needed
13. Step 1: create two forms as form1 and form2 and create database, databaset and one
table name as “student”
Step 2: In the form1 Project add new item report change name of the report
(for example “student.rdlc”)
Step 3: Now in the form1 report information appear right click the report
information Insert page header
Step 4viewtool box drag Text box and place ittype “Student
information”right click text box properties change font, color, size, font style
Step 5: toolbox text box (in the page header) place the mouse in the middle of the
text box and right click it expression built-in-function page number double click
Step 6: in the page footer toolbox text box place the mouse in the middle of the
text box and right click it expression common function date or time
Step 7 : toolbox table control name of the dataset1 (by default) data source
change it as (solution explorer .xsd name) table name
13
SUMMARY FOR PREPARING REPORT
14. Step 8: the above design will appear- right click the “Database symbol”
Step 9: insert one-by-one all the column in the table
Suppose required extra column then Right click the column top then insert column
right or left
14
15. Step 10 new form2 toolbox report report viewer drag and place it right
the arrow mark in the report control –choose report select your report (bonding
report)
Step 11: solution explorer vb project properties startup form
form2 run the form
15