expects parameter '@ID', which was not supplied?

Your ID parameter in the stored procedure must be set as OUTPUT parameter. You are just setting it in code not in stored procedure.


You seem to be calling a stored procedure - yet you've never defined your SqlCommand to be a stored procedure:

using (SqlCommand cmd = new SqlCommand("dbo.usp_ClientHistoryItem", conn))
{
    cmd.CommandType = CommandType.StoredProcedure;  // add this line to tell ADO.NET it's a stored procedure!!

If you forget that line, then ADO.NET will try to interpret your stuff as an ad-hoc SQL statement....


this one solve my problem may be it may helpful

cmd.CommandType = CommandType.StoredProcedure;