0

我有这个查询typed dataset用于填写我的ReportViewer

SELECT        proj.descricao AS projeto, func.descricao AS funcionalidade, clb.clube AS cliente, ch.descricao
FROM            chamados ch INNER JOIN
                         projetos proj ON ch.projeto = proj.id INNER JOIN
                         funcionalidades func ON ch.funcionalidade = func.id INNER JOIN
                         clubes clb ON ch.clube = clb.id
WHERE        (ch.responsavel = @responsavel) AND (ch.clube = @clube)

看到parameters @responsavel@clube?我现在想知道如何从codebehind. 谢谢 !Obs:我知道如何在 windowsForms 中执行此操作,但是对于 Web 应用程序,它有所不同,我不知道它是如何工作的。

4

1 回答 1

1

我刚刚找到了解决方案- 你需要在ObjectDataSource1_Selecting活动中工作。我曾经Sessions将值传递给一个网页到另一个网页。这是代码:

protected void ObjectDataSource1_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
        {
            string usrValue = Session["usrValue"].ToString();
            string usrText = Session["usrText"].ToString();
            string cliente = Session["cliente"].ToString();

            e.InputParameters["responsavel"] = usrValue;
            e.InputParameters["clube"] = cliente;
        }
于 2013-01-29T11:42:39.030 回答