I'm trying to set a formview datasource parameter dynamically on page_load
using the following code:
public void Page_Load(objec t sender, EventArgs e)
{
SqlParameter param = new SqlParameter();
param.Parameter Name = "@department_id ";
param.Value = "e62bbc7d623f44 a68e101cba90e83 9s3";
formview_dataso urce.SelectPara meters.Add(para m);
}
But I'm getting the following error: Compiler Error Message: CS1502: The
best overloaded method match for
'System.Web.UI. WebControls.Par ameterCollectio n.Add(System.We b.UI.WebControl s.Parameter)'
has some invalid arguments
Am I going about this wrong? What is the best way to dynamically set a
datasource parameter?
Thanks,
Brad
using the following code:
public void Page_Load(objec t sender, EventArgs e)
{
SqlParameter param = new SqlParameter();
param.Parameter Name = "@department_id ";
param.Value = "e62bbc7d623f44 a68e101cba90e83 9s3";
formview_dataso urce.SelectPara meters.Add(para m);
}
But I'm getting the following error: Compiler Error Message: CS1502: The
best overloaded method match for
'System.Web.UI. WebControls.Par ameterCollectio n.Add(System.We b.UI.WebControl s.Parameter)'
has some invalid arguments
Am I going about this wrong? What is the best way to dynamically set a
datasource parameter?
Thanks,
Brad
Comment