0% found this document useful (0 votes)
15 views4 pages

Practical No - 28 - 29 and 30 Gad 22034

Uploaded by

suya24telang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views4 pages

Practical No - 28 - 29 and 30 Gad 22034

Uploaded by

suya24telang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Practical No.28, 29 & 30: Understand the concept of data Binding.

Practical No 28, 29 & 30


GRAMIN TECHNICAL AND MANGEMENT CAMPUS
DEPARTMENT OF COMPUTER ENGINEERING
SUBJECT /CODE /:GAD 23034

Practical No 28 ,29,30
Name: suyash telang
Roll No:- 35
DOP: DOS:
CODE:

1. Write a program using data binding in VB.Net




Imports System.Data.OleDb
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim con As OleDbConnection
Dim ds As New DataSet
Dim cmd As OleDbCommand
Dim da As OleDbDataAdapter
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Purva\
Documents\Visual Studio 2012\Projects\Data binding\Student.mdb") con.Open()

cmd = New OleDbCommand("Select * From student", con) da = New


OleDbDataAdapter(cmd) da.Fill(ds, "student")

GUI Application Development using VB.Net (22034) Page 1


Practical No.28, 29 & 30: Understand the concept of data Binding.

TextBox1.DataBindings.Add("Text", ds, "student.Roll_No")


TextBox2.DataBindings.Add("Text", ds, "student.Name")
TextBox3.DataBindings.Add("Text", ds, "student.Marks")

End Sub
End Class
Output:

1. Write syntax of simple binding for text box.


 TextBox1.DataBindings.Add(“Text”, Dataset11, ”table.empid”)
2. Write a syntax of complex binding for combo box.
 ComboBox1.DataSource=ds.Tables(“table_name”)
ComboBox1.DisplayMember=”field_name”

2. Design a windows application for student name and college name using a simple
data binding use appropriate database.











Imports System.Data.OleDb
Public Class Form1
 

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load


Dim con As OleDbConnection Dim
ds As New DataSet

GUI Application Development using VB.Net (22034) Page 2


Practical No.28, 29 & 30: Understand the concept of data Binding.

Dim cmd As OleDbCommand


Dim da As OleDbDataAdapter
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Users\Purva\Documents\Visual Studio 2012\Projects\student data
binding\db1.mdb") con.Open()
cmd = New OleDbCommand("Select * From Student", con)
da = New OleDbDataAdapter(cmd) da.Fill(ds, "Student")
TextBox1.DataBindings.Add("text", ds, "Student.Name")
TextBox2.DataBindings.Add("text", ds, "Student.College")
End Sub
End Class

OUTPUT:

2. Design a windows application for bank customer record & display it using Complex
data binding use appropriate database.








Imports System.Data.OleDb
Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

Dim con As OleDbConnection


Dim ds As New DataSet
Dim cmd As OleDbCommand
Dim da As OleDbDataAdapter

con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data


Source=C:\Users\Purva\Documents\Visual Studio 2012\Projects\Bank Customer
Record\db1.mdb")
con.Open()

GUI Application Development using VB.Net (22034) Page 3


Practical No.28, 29 & 30: Understand the concept of data Binding.

cmd = New OleDbCommand("Select * From Bank_Details", con)


da = New OleDbDataAdapter(cmd) da.Fill(ds, "Bank_Details")

ComboBox1.DataSource = ds.Tables("Bank_Details")
ComboBox2.DataSource = ds.Tables("Bank_Details")
ComboBox3.DataSource = ds.Tables("Bank_Details")

ComboBox1.DisplayMember = "Acc_No"
ComboBox2.DisplayMember = "Balance"
ComboBox3.DisplayMember = "Branch"

End Sub
End Class
OUTPUT:

GUI Application Development using VB.Net (22034) Page 4

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy