dualshock03
Well-known member
- Joined
- Jan 28, 2007
- Messages
- 105
- Programming Experience
- 1-3
ey Pros! could u guys help me fix this code??
im trying to make a search in the database using the DataGridview with the ADODB connection.
The connection does work and it can read from the database but my datagridview doesnt populate the fields..its empty! Im using MySQL database
Here is the Module for the ADODB declaration:
plss. reply as soon as possible, tnx again!
ANY COMMENTS SUGGESTIIONS, REACTIONS!! ARE VERY WELL APPRECIATED... PLS REPLY FOR ANY ALTERNATIVES OF THIS CODE THNX!!
As for my billing system topic!, for those who read that thread, i already made contract to an instructor to create that system in exchange for a billion BUCKS!! hehehe
im trying to make a search in the database using the DataGridview with the ADODB connection.
The connection does work and it can read from the database but my datagridview doesnt populate the fields..its empty! Im using MySQL database
VB.NET:
[SIZE=2]Private Sub button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button2.Click
If dupdowncatgry.Text = "Percussion Instruments" And combo1.Text = "Idiophone" Then
Dim ds As New DataSet
Call adodb()
adorec.Open("SELECT * FROM percussion WHERE Idiophones = '" & txtsearch2.Text & "'", adocon, Global.ADODB.CursorTypeEnum.adOpenDynamic, Global.ADODB.LockTypeEnum.adLockOptimistic)
If adorec.EOF = False Then
DataGridView1.DataSource = (ds.Tables("percussion"))
DataGridView1.DataMember = "percussion"
Else
MsgBox("Record Not Found")
End If
adorec.Close()
adocon.Close()
End If
[/SIZE]
VB.NET:
#Region "Microsoft ActiveX 2.0 Lib Connection"
Module Module1
Public adocon As New ADODB.Connection
Public adorec As New ADODB.Recordset
Public Sub adodb()
adocon.ConnectionString = "DRIVER={MYSQL ODBC 3.51 DRIVER};" _
& "SERVER=localhost;" _
& "DATABASE=instrument;" _
& "UID=root;PWD=pat;OPTION=3"
adocon.Open()
End Sub
End Module
#End Region
ANY COMMENTS SUGGESTIIONS, REACTIONS!! ARE VERY WELL APPRECIATED... PLS REPLY FOR ANY ALTERNATIVES OF THIS CODE THNX!!
As for my billing system topic!, for those who read that thread, i already made contract to an instructor to create that system in exchange for a billion BUCKS!! hehehe
Last edited: