Oledb Exception 'No value given for one or required parameter C# update query

68 views Asked by At

I'm trying to update some table columns. However, I'm getting the following exception during execution, and I don't know why:

'No value given for one or required parameter C# update query'

This is the code in question:

string qry = "UPDATE party_mast SET party_id_no = @partyID, contact_persn = @pContactPersn, tinno = @pTin, Phone_no = @pPhone, Fax_No = @pFax, E_mail = @pEmail, address = @pAddress, disc = @pDisc, pnote = @pNote  WHERE party_name='"+name+"'";

OleDbCommand cm = new OleDbCommand(qry, cn);
cm.Parameters.AddWithValue("@partyID",pCst.Text);
cm.Parameters.AddWithValue("@pContactPersn,", pConatctPer.Text);
cm.Parameters.AddWithValue("@pTin", pTin.Text);
cm.Parameters.AddWithValue("@pFax", pFax.Text);
cm.Parameters.AddWithValue("@pEmail", pEmail.Text);
cm.Parameters.AddWithValue("@pAddress", pAdddress.Text);
cm.Parameters.AddWithValue("@pDisc", pDisc.Text);
cm.Parameters.AddWithValue("@pNote ", pNote.Text);

int x = cm.ExecuteNonQuery();
0

There are 0 answers