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 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mitesh MistryPosted Jun 11, 2015, 7:29 AM
Khan Abrar AhmedPosted Jun 11, 2015, 6:53 AM