Saturday, January 2, 2010

How To Connect MS Access Database In vb.net With Database Password(Select Data)

SELECT Statement

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.


No comments:

Post a Comment