Practical No 24
Practical No 24
I. Practical Significance:
ActiveX Data Object. NET (ADO.NET) is a set of framework database programming
classes (System. Data namespace) that render the data access services of the .NET
framework.
Experiments and practice: Plan to perform experiments and practices to use the
results to solve the computer group related problems.
• Write an NET program for database connection with data Grid view.
• Compile/Debug/Save the „VB.NET‟
V. Practical Outcome
Write a program to fetch data from table and display in Data Grid.
• Follow safety
• Follow ethical
SQL Data Provider Sql For interacting with Microsoft SQL Server.
Connection
Dim Con As OleDbConnection
Command
Dim cmd As OleDbCommand
DataReader
Dim dr As OleDbDataReader
Dr=cmd.ExecuteReader
Dim dr As SqlDataReader
Dr=cmd.ExecuteReader
DataSet
Dim dataset As New DataSet()
Da.fill(dataset, “table1”)
DataGrid
DataGridView1.DataSource = ds.Tables(0)
IX. Precautions
• https://www.tutorialspoint.com/vb.net/vb.net
Imports System.Data.OleDb
stud.mdb”)
Conn.Open()
da.Fill(ds, “Marks”)
DataGrid1.CaptionText = “marks”
DataGrid1.DataSource = ds
DataGrid1.DataMember = “marks”
End Sub
End Class
OleDbConnection(“Provider=Microsoft.Jet.OLEDB.4.0DataSource=D:\mydata.accdb;”
)
Error 3: ‘Conn’ is not declared. It may be inaccessible due to its protection level.
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDB.accdb
• Design the windows application that will dispaly the content of a table in MS-
Access database on DataGrid control using data
1. Design the windows application that will display the content of a table in
MS-Access database on DataGrid control using data adapter.
Imports System.Data
Imports System.Data.OleDb
Advertisements
conn.Open()
DataGrid1.CaptionText = “Student”
DataGrid1.DataSource = ds
End Sub
End Class
OUTPUT: