Re: Best practice



If that object has no method to set all of them, then there is nothing you
can do.

I honestly don't think you are going to see an actual performance problem by
having to set 9 properties instead of calling 1 method.

"Diffident" <Diffident@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9CD93E76-493A-408F-AE37-604D18C0CB35@xxxxxxxxxxxxxxxx
> Hello All,
>
> Best coding strategies for calling stored procedures from ASP.NET. As you
> are all aware that accessing a property is expensive than calling a
> method.
> For example in order to call a stored procedure which accepts 2 input
> parameters, we are currently following the below standard to set a single
> parameter:
>
> objOracleParameterSTATUS = new System.Data.OracleClient.OracleParameter
> ();
> objOracleParameterSTATUS.ParameterName ="STATUS_IN";
> objOracleParameterSTATUS.SourceColumn = "STATUS";
> objOracleParameterSTATUS.OracleType=System.Data.OracleClient.OracleType.Number;
> objOracleParameterSTATUS.Size =1;
> objOracleParameterSTATUS.Precision =0;
> objOracleParameterSTATUS.Scale =0;
> objOracleParameterSTATUS.Direction = System.Data.ParameterDirection.Input;
> objOracleParameterSTATUS.SourceVersion=System.Data.DataRowVersion.Current;
> objOracleParameterSTATUS.Value =STATUS;
> bjOracleCommand.Parameters.Add (objOracleParameterSTATUS);
>
> So on the whole we are setting 9 properties for a single parameter and if
> this stored procedure accepts 10 parameters, then this process has to be
> repeated for those many parameters.
>
> Can any of the solution developers suggest me an alternative choice for
> the
> above code or how can I make this less expensive and efficient.
>
> Thanks for your help!!!


.



Relevant Pages

  • Re: DBD::Sybase and $sth->{syb_result_type} v. DBD::ODBC (Sql Server)
    ... write output parameters and return a value. ... individual operations in the procedure by calling odbc_more_results. ... Things get a little more complex for what I guess Sybase calls CS_MSG_RESULT ... the status from a stored procedure was ...
    (perl.dbi.users)
  • Re: xplog70.dll
    ... What extended stored procedure are you calling from ... >I have a job that executes a DTS-package which in turn call a store procedure ...
    (microsoft.public.sqlserver.security)
  • Re: Foreign key constraints problem in SNC SQL Native client
    ... calling one stored procedure before calling dw_1.update method. ... stored procedure system is trying to delete parent data from Table A. ... rows from table B before deleting the related rows from A. ...
    (microsoft.public.sqlserver.connect)
  • Re: ntext/>8K as OUTPUT param
    ... You can create a temporary table in the calling stored procedure, ... > very complex and needs to EXEC some sql which cannot be done in a UDF. ... > I have found some references to calling a COM .dll using sp_OA*, ...
    (microsoft.public.sqlserver.programming)
  • Re: Best practice
    ... >>>Best coding strategies for calling stored procedures from ASP.NET. ... >>>So on the whole we are setting 9 properties for a single parameter and if ... >>>this stored procedure accepts 10 parameters, then this process has to be ...
    (microsoft.public.dotnet.framework.aspnet)