In This File You Can Installer And Uninstall Your Program :
Saturday, January 2, 2010
How To Connect MS Access Database In vb.net With Database Password (Data Delete)
Delete Statement:
Create form:
Codes For delete Button:
Dim con As OleDbConnection
Dim com As OleDbCommand
con = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=C:\Program Files\new\Database.mdb;Jet OLEDB:Database Password=125122;")
com = New OleDbCommand("delete * from student where stid=@id", con)
con.Open()
com.Parameters.AddWithValue("@id", TextBox1.Text)
com.ExecuteNonQuery()
con.Close()
How To Connect MS Access Database In vb.net With Database Password(Insert to Database)
INSERT statement:
Create form like this:
Codes for Add Button
Dim con As OleDbConnection
Dim com As OleDbCommand
con = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=C:\Program Files\new\Database.mdb;Jet OLEDB:Database Password=125122;")
com = New OleDbCommand("insert into student values(@stid)", con)
If (f = 1) Then
con.Open()
com.Parameters.AddWithValue("@1", TextBox1.Text)
If (com.ExecuteNonQuery()) Then
MsgBox("Student Data is Added sucessfully...")
con.Close()
How To Connect MS Access Database In vb.net With Database Password(Select Data)
Create a form like This:
and these code for Check Button
Dim con As OleDbConnection
Dim ad As OleDbDataAdapter
Dim ds As New DataSet
Dim x As Integer = TextBox1.Text
con = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=C:\Program Files\new\Database.mdb;Jet OLEDB:Database Password=125122;")
ad = New OleDbDataAdapter("select * from student where stid=" & x, con)
con.Open()
ad.Fill(ds, "student")
DataGridView1.DataSource = ds
DataGridView1.DataMember = "student"
After You type a value in the text box and click "Check " button you get the all result in database where value you type.