Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Parameters.count equals 0
I am using VB.NET 2005 to access a MySQL 5 database.
I expected the following code snippet to give me a parameter count of 3 but it gives me 0.
- The connection to DB is established (tested)
[code]'Create a connection to DB
Dim cn as New ADODB.Connection
cn.Mode = ADODB.ConnectModeEnum.adModeReadWrite
cn.CursorLocation = ADODB.CursorLocationEnum.adUseClient
'Run Parameter Query
Dim cmd As New ADODB.Command
cmd.ActiveConnection = cn
cmd.CommandText = "INSERT INTO `tblgroups` ( " & _
" `groupID` , `GroupName` , `Description` " & _
" ) VALUES ( " & _
" ? , ? , ? " & _
Msgbox(cmd.Parameters.count) ' It gives me 0, WHY????