Best practice

Tech-Archive recommends: Speed Up your PC by fixing your registry



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: 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)
  • Re: Best practice
    ... by the optimizing compiler, so they won't be as expensive as a method ... >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)
  • Re: Best practice
    ... Instead of coding these many lines for each and every parameter, ... >>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)
  • Re: Best practice
    ... > Best coding strategies for calling stored procedures from ASP.NET. ... > objOracleParameterSTATUS = new System.Data.OracleClient.OracleParameter ... > 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)
  • Re: SQL Parameter
    ... A popular approach is to fake an array of values into a single parameter & ... pass it to the stored procedure. ... Various methods of handling it are detailed ...
    (microsoft.public.sqlserver.programming)