Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Runtime error on Deleting Record
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Runtime error on Deleting Record
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
Jet/Access Engine
Miscellaneous
Thread ID:
01160451
Message ID:
01160451
Views:
46
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
Map
View

Click here to load this message in the networking platform