创建和初始化SqlCmmand对象的方法
标准的代码如下:
sqlCommand command = new sqlCommand();
command.Connection = connection;
command.CommandText = "GetStoreProcedure";
command.CommandType = CommandType.StoreProcedure;
最简洁的代码如下:command.Connection = connection;
command.CommandText = "GetStoreProcedure";
command.CommandType = CommandType.StoreProcedure;
sqlCommand command = new sqlCommand("GetStoreProcedure",connection);
command.Commandtype = CommandType.StoredProcedure;
command.Commandtype = CommandType.StoredProcedure;
金戈铁马