Hi,
I'm now using Visual Basic 2005. I need some help in my database. Right now, i've already managed to connect my program with the database. But i don't know how to continue from there. I have a toneLabel where the values change accordingly when a button is pressed. When i select a name from a combo box, and click presentButton, it should get values (under that name) from the database. If the toneLabel value corresponds to the value from the database (for that particular name), a smiley face will appear.
If toneLabel.text >= (value from database, eg. AC250L, AC250R)
Me.PictureBox1.Visible = True
tmrTimer.Interval = 1000
tmrTimer.Enabled = True
Just that i don't know how to retrieve the values and compare it with the toneLabel value (without having to display it on my GUI).
Here are some of my codes..
Private Sub BIEMaskingMachine_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Actual_DatabaseDataSet.Threshold_Database' table. You can move, or remove it, as needed.
Me.Threshold_DatabaseTableAdapter.Fill(Me.Actual_D atabaseDataSet.Threshold_Database)
Dim con As New OleDb.OleDbConnection
con.ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = D:\project1\BIEProject\Actual Database.mdb;Jet OLEDBatabase Password=xxxx"
con.Open()
MsgBox("A Connection is now open")
'Use a variable to hold the SQL statement.
Dim selectString As String = "SELECT Name, AC250L, AC250L, BC250L, BC250R, AC500L, AC500R, BC500L, BC500R, AC750L, AC750R, BC750L, BC750R, AC1KzL, AC1KzR, BC1KzL, BC1KzR, AC15KL, AC15KR, BC15KL, BC15KR, AC2KzL, AC2KzR, BC2KzL, BC2KzR, AC3KzL, AC3KzR, BC3KzL, BC3KzR, AC4KzL, AC4KzR, BC4KzL, BC4KzR, AC6KzL, AC6KzR, BC6KzL, BC6KzR, AC8KzL, AC8KzR, BC8KzL, BC8KzR "
'Create an OleDbCommand object.
Dim cmd As OleDb.OleDbCommand = New OleDb.OleDbCommand(selectString, con)
con.Close()
MsgBox("A Connection is now closed")
End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks