Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
what's the wrong in this method ????

public void ApplyNoneQuerySP(string ProcName, string[] param, object[] value)
{
cmd = new SqlCommand(ProcName,cnn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(param, value);
cnn.Open();
int rows = cmd.ExecuteNonQuery();
cnn.Close();
}
Posted
Updated 8-Dec-11 4:23am
v2
Comments
Smithers-Jones 8-Dec-11 10:23am    
Added code-block.
R. Giskard Reventlov 8-Dec-11 10:25am    
It's the wrong font? Perhaps if you could tell us what the error is it might help. Sadly, my telepathic powers are being dulled today by the inclement weather.

AddWithValue cannot take a string[] as a parameter as far as I know.

You'll need to change the way you pass "string[] param, object[] value"
to the AddWithValue
 
Share this answer
 
Comments
Sarah Mohammed77 8-Dec-11 14:21pm    
yes I think so too but I don't know what it will be????

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900