× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello,



I have a simple program that loads data from a table from the iSeries
into a datagridview. The program defines the four commands (select,
update, insert, delete). The program loads the data correctly into the
datagrid, I am able to edit it. I also have a button to save any
changes on the datagridview back to the table. However, when I press
the Save button, I'm getting an error saying that the number of
parameters is incorrect. The table has only three columns and that's
the number of parms that I have built into the Update command. The
error message that I'm getting is:



Not enough parameters specified. The command requires 4 parameter(s),
but only 3 parameter(s) exist in the parameter collection.



This is how I built the update command:



Dim cmdUpdate As iDB2Command = mcnn.CreateCommand()

cmdUpdate.CommandType = CommandType.Text

cmdUpdate.CommandText = "UPDATE COHAMIRA.COHMCH01PF SET " & _

"MCHGROUP = @MCHGROUP, MCHID = @MCHID, MCHNAME = @MCHNAME " & _

"WHERE MCHID = @MCHID"

cmdUpdate.Parameters.Add("@MCHGROUP", iDB2DbType.iDB2Char, _

3, "MCHGROUP")

cmdUpdate.Parameters.Add("@MCHID", iDB2DbType.iDB2Decimal, _

6, "MCHID")

cmdUpdate.Parameters("@MCHID").Scale = 0

cmdUpdate.Parameters.Add("@MCHNAME", iDB2DbType.iDB2Char, _

50, "MCHNAME")

cmdUpdate.Parameters("@MCHID").SourceVersion = _

DataRowVersion.Original





Any ideas on why I'm getting this error? Any help would be greatly
appreciated.



Thank you,



Antonio Mira

Application Developer - Mid-Ohio Division

Time Warner Cable

1015 Olentangy River Road - 2nd Floor

Columbus, OH 43212

http://www.timewarnercable.com

phone: 614 827 7949





This E-mail and any of its attachments may contain Time Warner
Cable proprietary information, which is privileged, confidential,
or subject to copyright belonging to Time Warner Cable. This E-mail
is intended solely for the use of the individual or entity to which
it is addressed. If you are not the intended recipient of this
E-mail, you are hereby notified that any dissemination,
distribution, copying, or action taken in relation to the contents
of and attachments to this E-mail is strictly prohibited and may be
unlawful. If you have received this E-mail in error, please notify
the sender immediately and permanently delete the original and any
copy of this E-mail and any printout.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.