C# SqlParameter对象在C中的性能#

C# SqlParameter对象在C中的性能#,c#,ado.net,C#,Ado.net,我正在使用C#中的一个大型会计软件,该软件使用存储过程参数,该参数是使用SqlParameter对象添加的: SqlCommand sccmd = new SqlCommand("AccountGroupAdd", sqlcon); sccmd.CommandType = CommandType.StoredProcedure; SqlParameter sprmparam = new SqlParameter(); sprmparam = sccmd.Parameters.Add("@acc

我正在使用C#中的一个大型会计软件,该软件使用存储过程参数,该参数是使用
SqlParameter
对象添加的:

SqlCommand sccmd = new SqlCommand("AccountGroupAdd", sqlcon);
sccmd.CommandType = CommandType.StoredProcedure;
SqlParameter sprmparam = new SqlParameter();

sprmparam = sccmd.Parameters.Add("@accountGroupName", SqlDbType.VarChar);
sprmparam.Value = accountgroupinfo.AccountGroupName;
现在,我想知道是否通过将
SqlParameter
对象作为

SqlCommand sccmd = new SqlCommand("AccountGroupAdd", sqlcon);
            sccmd.CommandType = CommandType.StoredProcedure;
sccmd.Parameters.Add("@accountGroupName", SqlDbType.VarChar).Value = accountgroupinfo.AccountGroupName;

提高应用程序的性能?

创建对象需要时间,因此下面的代码必须需要时间来创建

SqlParameter sprmparam = new SqlParameter();

上面的大量内容将花费大量时间。

为什么您需要问我们何时可以自己测试它?我投票将这个问题作为离题题来结束,因为这个问题可以简单地通过测试代码来回答。不,这不会提高您的应用程序性能。。。每个类只做一次创建。但分配给该对象的操作已执行多次。