General information
Category:
The Mere Mortals .NET Framework
Title:
Runtime error on Deleting Record
Environment versions
Database:
Jet/Access Engine
Kelvin,
I first got this error when I tried to update an existing record.
"OleDbCommand.Prepare method requires all parameters to have an explicitly set type."
I noticed that the update command was built on top of select command for the dataset. When I changed the SQLParameter by setting its dbtype. The Update now works. The "Deletion" still has the same error. Here are the code changes that I had made:
IDbDataParameter prodIDParam = this.CreateParameter("@ProductID", productID);
prodIDParam.DbType = DbType.Int32;
this.GetDataSet("SELECT * FROM Products WHERE ProductID = @ProductID", prodIDParam);
Shouldn't this work for the deleting as well as update?
Peter
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only