this code for a parameterized update query is giving me an error that i cant figure out what the problem is. my code:
the error:
is my query wrong? any ideas?
Code:
updateCommand1 = New OleDb.OleDbCommand("INSERT INTO Event_Nuclear (SS_Patient_ID, EventAge, Weight, Height, StudyType, EventDate,StudyNumber, PILocation, Indication) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", Me.OleDbConnection1)
updateCommand1.Parameters.Add(New OleDb.OleDbParameter("PID", OleDb.OleDbType.Numeric, 10))
updateCommand1.Parameters.Add(New OleDb.OleDbParameter("EventAge", OleDb.OleDbType.Numeric, 3))
updateCommand1.Parameters.Add(New OleDb.OleDbParameter("Weight", OleDb.OleDbType.Numeric, 3))
updateCommand1.Parameters.Add(New OleDb.OleDbParameter("Height", OleDb.OleDbType.Numeric, 3))
updateCommand1.Parameters.Add(New OleDb.OleDbParameter("StudyType", OleDb.OleDbType.VarChar, 40))
updateCommand1.Parameters.Add(New OleDb.OleDbParameter("RNADate", OleDb.OleDbType.Date))
updateCommand1.Parameters.Add(New OleDb.OleDbParameter("StudyNo", OleDb.OleDbType.VarChar, 15))
updateCommand1.Parameters.Add(New OleDb.OleDbParameter("Location", OleDb.OleDbType.VarChar, 30))
updateCommand1.Parameters.Add(New OleDb.OleDbParameter("Indication", OleDb.OleDbType.Numeric))
updateCommand1.Prepare()
the error:
Code:
System.InvalidOperationException: OleDbCommand.Prepare method requires parameters of type 131 have an explicitly set Precision and Scale.
at System.Data.OleDb.OleDbParameter.Prepare(OleDbCommand cmd)
at System.Data.OleDb.OleDbCommand.PrepareCommandText(Int32 expectedExecutionCount)
at System.Data.OleDb.OleDbCommand.Prepare()
is my query wrong? any ideas?