0

我有一个要填充 Gridview2 的 gridview1

Gridview1 声明如下:

<asp:GridView runat="server" ID="gwDup" AllowPaging="True" AllowSorting="True" PageSize="15" DataKeyNames="CASEID, Column2, ADATE, adddate"     AutoGenerateColumns="False" DataSourceID="SqlDataSource1"` >
 <asp:CommandField ShowSelectButton="True" />

    <asp:BoundField DataField="Column1" HeaderText="Possible Duplicates" ReadOnly="True" 
        SortExpression="Column1" />
    <asp:BoundField DataField="CASEID" HeaderText="CASEID" 
        SortExpression="CASEID" />
    <asp:BoundField DataField="Column2" HeaderText="Column2"            SortExpression="Column2" />
    <asp:BoundField DataField="ADATE" HeaderText="ADATE" SortExpression="ADATE" />
    <asp:BoundField DataField="AddDate" HeaderText="AddDate" 
        SortExpression="AddDate" />
</Columns>
</asp:GridView>

当我点击选择时,我已经输入了一个函数来检查传入的值:

protected void SqlDataSource2_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
    {
        foreach (ControlParameter s in SqlDataSource2.SelectParameters)
        {
            Response.Write(s.ToString());
        }
    }

(我正在使用调试器来获取值,而不是 response.write ...)

尽管参数名称似乎发生了应有的变化,但值始终相同(caseID,这是第一个参数)我在这里做错了吗?如何为所有 4 个参数传入相同的值?

4

0 回答 0