It appears that
OLE DB .NET Provider
does not support named parameters.
Try this:
updatenow.Connection = con;
updatenow.CommandText = "update Member set MName=?, MAddress=?, Society=?, Group=?, Contact=? where EN_NO=?";
updatenow.Parameters.Add("MName", OleDbType.VarWChar);
updatenow.Parameters["MName"].Value = MName;
updatenow.Parameters.Add("MAddress", OleDbType.VarWChar);
updatenow.Parameters["MAddress"].Value = MAddress;
updatenow.Parameters.Add("Society", OleDbType.VarWChar);
updatenow.Parameters["Society"].Value = Society;
updatenow.Parameters.Add("Group", OleDbType.VarWChar);
updatenow.Parameters["Group"].Value = Group;
updatenow.Parameters.Add("Contact", OleDbType.VarWChar);
updatenow.Parameters["Contact"].Value = Contact;
updatenow.Parameters.Add("EN_NO", OleDbType.VarWChar);
updatenow.Parameters["EN_NO"].Value = EN_NO;
See
OLEDBCommand.Parameters property[
^]
Quote:
The OLE DB .NET Provider does not support named parameters for passing parameters to an SQL statement or a stored procedure called by an OleDbCommand when CommandType is set to Text. In this case, the question mark (?) placeholder must be used
@OriginalGriff: Thanks for the tip about ? positional parameters. Never used
OLDDBCommand
before so looked it up in the Help file and learned.