Hello ,
I am trying to call method whose parameter is storedprocedurename and sqlparameter array For example
Method Defination :
[WebMethod]
public DataSet GetDetail(string strProcedureName, CommandType strCommandType)
{
strCommandType = CommandType.StoredProcedure;
DataSet objGetResult = ConnectionClass.Select(strProcedureName, strCommandType);
return objGetResult;
}
Method Call :
localhost.SqlParameter[] param = new localhost.SqlParameter[2];
param[0] = new localhost.SqlParameter("KeyWord", SqlDbType.NVarChar);
param[0].Value = "Testing"
param[1] = new localhost.SqlParameter("PageSize", SqlDbType.Int);
param[1].Value = 20;
var objGetDetail = Obj1.GetDetail("SP_Related", param).Tables[0];
When i call like this we get error :
'localhost.SqlParameter' does not contain a constructor that takes 2 arguments
Please give any suggetion for this problem
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Khan Abrar AhmedRank #778 · 3K reputationPosted Jun 11, 2015, 2:53 AM EDT
Mitesh Mistry93 reputationPosted Jun 11, 2015, 3:29 AM EDT