B
Brad Baker
I'm trying to set a formview datasource parameter dynamically on page_load
using the following code:
public void Page_Load(object sender, EventArgs e)
{
SqlParameter param = new SqlParameter();
param.ParameterName = "@department_id";
param.Value = "e62bbc7d623f44a68e101cba90e839s3";
formview_datasource.SelectParameters.Add(param);
}
But I'm getting the following error: Compiler Error Message: CS1502: The
best overloaded method match for
'System.Web.UI.WebControls.ParameterCollection.Add(System.Web.UI.WebControls.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(object sender, EventArgs e)
{
SqlParameter param = new SqlParameter();
param.ParameterName = "@department_id";
param.Value = "e62bbc7d623f44a68e101cba90e839s3";
formview_datasource.SelectParameters.Add(param);
}
But I'm getting the following error: Compiler Error Message: CS1502: The
best overloaded method match for
'System.Web.UI.WebControls.ParameterCollection.Add(System.Web.UI.WebControls.Parameter)'
has some invalid arguments
Am I going about this wrong? What is the best way to dynamically set a
datasource parameter?
Thanks,
Brad