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()
No comments:
Post a Comment