Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SP execution in .NET is very slow
Message
 
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
Environment:
C# 1.1
Database:
MS SQL Server
Miscellaneous
Thread ID:
01061878
Message ID:
01061901
Views:
11
Kevin,

This is function, which contains Fill():
      public StoredProcParameter[] Execute(ref DataSet ds, string strSpName, StoredProcParameter[] _arrParams,TransactionEx tran)
      {
         StoredProcParameter[] _arrOutParams = null;
         using (TransactionHolder tranHolder = new TransactionHolder(tran))
         {
            using (SqlCommand sqlCmd = new SqlCommand(strSpName, tranHolder.Connection, tranHolder.SqlTransaction))
         {
            sqlCmd.CommandType = CommandType.StoredProcedure;
            // set command time-out to 15 minites
            sqlCmd.CommandTimeout = _nStoredProcTimeout;

            // prepare command parameters
            PrepareStoredProcedureParams(strSpName, sqlCmd, _arrParams);

            using (SqlDataAdapter da = new SqlDataAdapter(sqlCmd))
            {
               string strTableName = strSpName;
               da.Fill(ds, strTableName);
            }
            tranHolder.Commit();
            _arrOutParams = TransformParams(sqlCmd.Parameters);
         }
         }
         return _arrOutParams;
      }
Connection is already open at that moment, and created with first access to TransactionHolder.Connection property:
	get 
	{ 
		return new SqlConnection(strDBConnectionString); 
	}
Thank you,
Alexander

>Alexander,
>
>I've never come across that large a difference in times. Can you post the .NET code, from the point where you're doing the connection, to the point where you're doing the Fill()?
>
>Thanks,
>Kevin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform