Hi a newbie to ASP.net but have got the majority of my code working (fingers crossed) I'm currently working on update pages when this error comes up.
Any Ideas?
Line 384: dbParam_Notes.ParameterName = "?Notes"
Line 385: dbParam_Notes.Value = structCA_Medication.Notes
Line 386: dbParam_Notes.DbType = MySqlDbType.String
Line 387: dbCommand.Parameters.Add(dbParam_Notes)
Line 388:
Source File: C:\inetpub\wwwroot\HealthActionPlan\frmcurrentmed.aspx Line: 386
Private Sub DBInsertBaseMedication(ByRef structCA_Medication As CA_Medication)
Dim strErrMsg As String = ""
Dim myTrans As MySqlTransaction
Dim myConnection As MySqlConnection
myConnection = New MySqlConnection(mstrConnectionString)
Dim dbCommand As MySqlCommand = myConnection.CreateCommand()
Dim dbParam_Notes As System.Data.IDataParameter = New MySqlParameter
dbParam_Notes.ParameterName = "?Notes"
dbParam_Notes.Value = structCA_Medication.Notes
dbParam_Notes.DbType = MySqlDbType.String
dbCommand.Parameters.Add(dbParam_Notes)
myConnection.Open()
dbCommand.Connection = myConnection
myTrans = myConnection.BeginTransaction()
dbCommand.Transaction = myTrans
Dim blnAddnew As Boolean = False
blnAddnew = True
Dim strSQL As String = _
"INSERT INTO currentmedication ( " & _
"Notes, " & _) " & _
"VALUES ( " & _
"?Notes, " & _); "
dbCommand.CommandText = strSQL & "SELECT LAST_INSERT_ID()"
dbCommand.ExecuteNonQuery()
myTrans.Commit()
dbCommand.Connection.Close()
myConnection.Dispose()
myConnection.Close()
End Sub
Thanks in advance
Mark
Any Ideas?
Line 384: dbParam_Notes.ParameterName = "?Notes"
Line 385: dbParam_Notes.Value = structCA_Medication.Notes
Line 386: dbParam_Notes.DbType = MySqlDbType.String
Line 387: dbCommand.Parameters.Add(dbParam_Notes)
Line 388:
Source File: C:\inetpub\wwwroot\HealthActionPlan\frmcurrentmed.aspx Line: 386
Private Sub DBInsertBaseMedication(ByRef structCA_Medication As CA_Medication)
Dim strErrMsg As String = ""
Dim myTrans As MySqlTransaction
Dim myConnection As MySqlConnection
myConnection = New MySqlConnection(mstrConnectionString)
Dim dbCommand As MySqlCommand = myConnection.CreateCommand()
Dim dbParam_Notes As System.Data.IDataParameter = New MySqlParameter
dbParam_Notes.ParameterName = "?Notes"
dbParam_Notes.Value = structCA_Medication.Notes
dbParam_Notes.DbType = MySqlDbType.String
dbCommand.Parameters.Add(dbParam_Notes)
myConnection.Open()
dbCommand.Connection = myConnection
myTrans = myConnection.BeginTransaction()
dbCommand.Transaction = myTrans
Dim blnAddnew As Boolean = False
blnAddnew = True
Dim strSQL As String = _
"INSERT INTO currentmedication ( " & _
"Notes, " & _) " & _
"VALUES ( " & _
"?Notes, " & _); "
dbCommand.CommandText = strSQL & "SELECT LAST_INSERT_ID()"
dbCommand.ExecuteNonQuery()
myTrans.Commit()
dbCommand.Connection.Close()
myConnection.Dispose()
myConnection.Close()
End Sub
Thanks in advance
Mark