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

Gramin Technical and Mangement Campus Gramin Technical and Mangement Campus Department of Computer Engineering

The document describes code for performing CRUD operations on a database table using OleDb. It includes code to insert, delete and update records in a table called 'table1' using buttons and text boxes for input. The code opens a connection and executes queries to perform the operations.

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)
18 views4 pages

Gramin Technical and Mangement Campus Gramin Technical and Mangement Campus Department of Computer Engineering

The document describes code for performing CRUD operations on a database table using OleDb. It includes code to insert, delete and update records in a table called 'table1' using buttons and text boxes for input. The code opens a connection and executes queries to perform the operations.

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

GRAMIN TECHNICAL AND MANGEMENT CAMPUS

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:
Imports System.Data.OleDb Public Class Formi
Dim en As OleDbConnection Dim cmd As OleDbCommand
Dim dr As OleDbDataReader Dim cnt As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
en New OleDbConnection ("Provider-Microsoft.Jet.OLEDB.4.0; Data
Source=C:\Users\LAB - 2 PC 20\Desktop\expt27.mdb")
cmd New OleDbCommand
cn.Open()
cmd.Connection en
cmd.CommandText = "INSERT INTO tablel (id, name) value(""
TextBox1.Text & ,& TextBox2.Text & "*"
cmd.ExecuteNonQuery(
en.close()
MsgBox("Saved!!!", vbox)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
en New OleDbConnection ("Provider-Microsoft.Jet.OLEDB.4.0; Data
Source=C:\Users\LAB - 2 PC 20\Desktop\expt27.mdb")
en.Open()
cmd = New OleDbCommand("Delete from tablel where id="
TextBox1.Text, en)
cmd.ExecuteNonQuery() 'not return values MessageBox.Show("record
deleted")
cn.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
en New OleDbconnection ("Provider-Microsoft.Jet.OLEDB.4.0; Data
Source=C:\Users\LAR - 2 PC 20\Desktop\expt27.mdb")
cmd = New OleDbCommand
en.Open()
cmd.Connection cn
cmd = New OleDbCommand("update tablel set name='abc' where id="
TextBox1.Text, cn)
cmd.ExecuteNonQuery()
'not return values
MessageBox.Show("record updated")
cn.Close()
End Sub
Private Sub Button2_click_1 (ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.click
Dim adi aa olerboatandapter
Dim ds As New DataSet()

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