Showing posts with label procedure. Show all posts
Showing posts with label procedure. Show all posts

Thursday, March 22, 2012

OleDbException: Too many arguments.

Hi,

I'm passing around 30 arguments to a stored procedure, and
I got the following error (see below).
It works fine if I narrow down to around 25 args. Is there
any workaround to bypass this exception, I need to pass 30
of them to my stored procedure. Thanks.
I'm using Framework 1.0.

--------
Too many arguments.
Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and where
it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Too
many arguments.

Source Error:

Line 663:
Line 664: 'execute SQL
Line 665: oCmd.ExecuteNonQuery()
Line 666:
Line 667: 'Catch exc As OleDbException
--------If you have any return parameters, they must be specified first. You should
declare any return parameters before you start adding input parameters. That
is commonly the reason for this error. Also, make sure that the order in
which you are adding your parameters match the order in the stored
procedure.

HTH,
Bill P.

"jn" <anonymous@.discussions.microsoft.com> wrote in message
news:001001c3aec9$13cedf10$a501280a@.phx.gbl...
> Hi,
> I'm passing around 30 arguments to a stored procedure, and
> I got the following error (see below).
> It works fine if I narrow down to around 25 args. Is there
> any workaround to bypass this exception, I need to pass 30
> of them to my stored procedure. Thanks.
> I'm using Framework 1.0.
> --------
> Too many arguments.
> Description: An unhandled exception occurred during the
> execution of the current web request. Please review the
> stack trace for more information about the error and where
> it originated in the code.
> Exception Details: System.Data.OleDb.OleDbException: Too
> many arguments.
> Source Error:
>
> Line 663:
> Line 664: 'execute SQL
> Line 665: oCmd.ExecuteNonQuery()
> Line 666:
> Line 667: 'Catch exc As OleDbException
> --------
arg, I found out it's Visual FoxPro problem (I'm using VFP
as the backend database), it just won't take more than 28
parameters. Thanks, Bill, for looking into my problem
though.

>--Original Message--
>If you have any return parameters, they must be specified
first. You should
>declare any return parameters before you start adding
input parameters. That
>is commonly the reason for this error. Also, make sure
that the order in
>which you are adding your parameters match the order in
the stored
>procedure.
>HTH,
>Bill P.
>
>"jn" <anonymous@.discussions.microsoft.com> wrote in
message
>news:001001c3aec9$13cedf10$a501280a@.phx.gbl...
>> Hi,
>>
>> I'm passing around 30 arguments to a stored procedure,
and
>> I got the following error (see below).
>> It works fine if I narrow down to around 25 args. Is
there
>> any workaround to bypass this exception, I need to pass
30
>> of them to my stored procedure. Thanks.
>> I'm using Framework 1.0.
>>
>> --------
>> Too many arguments.
>> Description: An unhandled exception occurred during the
>> execution of the current web request. Please review the
>> stack trace for more information about the error and
where
>> it originated in the code.
>>
>> Exception Details: System.Data.OleDb.OleDbException: Too
>> many arguments.
>>
>> Source Error:
>>
>>
>> Line 663:
>> Line 664: 'execute SQL
>> Line 665: oCmd.ExecuteNonQuery()
>> Line 666:
>> Line 667: 'Catch exc As OleDbException
>> --------
>>
>
>.

Friday, March 16, 2012

on error - continue

in a Try/Catch block - once an error is thrown, is there any way to set it
so that it will continue through the rest of the procedure?
(in the catch block, I'm firing off an email with the error message)Not sure what you mean.Continue?
Let say, If you can not open SQL connection is there any sense to attempt to
run SQL statement?
you have control how to continue by placing your TRY/CATCH statements.
Example
string sNumber = Request["id"];
int iNum = 0;
try
{
iNum = Int32.Parse(sNumber);
}
catch(Exception e)
{
..SEND EMAIL...
}
...continue here...
Print( iNum)
After you caught exception your application will continue. It will just
print 0 if sNumber was not an integer.
So by placing try/catch correctly you can tell compiler what to skip and
what to not.
George.
"Elmo Watson" <sm@.here.com> wrote in message
news:ex%23x60mPIHA.4584@.TK2MSFTNGP03.phx.gbl...
> in a Try/Catch block - once an error is thrown, is there any way to set it
> so that it will continue through the rest of the procedure?
> (in the catch block, I'm firing off an email with the error message)
>
>

on error - continue

in a Try/Catch block - once an error is thrown, is there any way to set it
so that it will continue through the rest of the procedure?
(in the catch block, I'm firing off an email with the error message)Not sure what you mean.Continue?

Let say, If you can not open SQL connection is there any sense to attempt to
run SQL statement?
you have control how to continue by placing your TRY/CATCH statements.

Example

string sNumber = Request["id"];
int iNum = 0;
try
{
iNum = Int32.Parse(sNumber);
}
catch(Exception e)
{
...SEND EMAIL...
}
....continue here...
Print( iNum)

After you caught exception your application will continue. It will just
print 0 if sNumber was not an integer.
So by placing try/catch correctly you can tell compiler what to skip and
what to not.

George.

"Elmo Watson" <sm@.here.comwrote in message
news:ex%23x60mPIHA.4584@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

in a Try/Catch block - once an error is thrown, is there any way to set it
so that it will continue through the rest of the procedure?
(in the catch block, I'm firing off an email with the error message)
>
>
>