T
tshad
I have to pass a parameter collection to a method and then add it to the
SqlCommand.
Can I do that without having to go throught a foreach loop?
I tried to do :
command.Parameters = sqlParams;
where sqlParams is an SqlParameterCollection.
But got a message saying that it was readonly.
I can loop through and just do:
if (sqlParams != null)
foreach(SqlParameter param in sqlParams)
dbCommand.Parameters.Add(param);
But was curious if I can just attach the collection?
Thanks,
Tom
SqlCommand.
Can I do that without having to go throught a foreach loop?
I tried to do :
command.Parameters = sqlParams;
where sqlParams is an SqlParameterCollection.
But got a message saying that it was readonly.
I can loop through and just do:
if (sqlParams != null)
foreach(SqlParameter param in sqlParams)
dbCommand.Parameters.Add(param);
But was curious if I can just attach the collection?
Thanks,
Tom