我试图通过此代码(第1页)将一些参数从一个页面传递到另一个页面:
protected void Button1_Click(object sender, EventArgs e)
{ Response.Redirect(string.Format("../ShowResult.aspx?&Name{0}&Finalfrom={1}&Finalto{2}",
Name.Text,
Paidfrom.Text,
Paidto.Text));
}
在第2页我有一个GridView来显示结果,这是我的SqlDataSource连接:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ProjectConnectionString %>" SelectCommand="SELECT [CaseNumber], [Name] FROM [Files] WHERE
(@Name IS NULL OR Name LIKE '%' + @Name + '%') AND
(@CaseNumber IS NULL OR CaseNumber LIKE '%' + @CaseNumber + '%') AND
(@paid IS NULL OR paid BETWEEN '@paidfrom' AND '@paidto' ) AND);"
CancelSelectOnNullParameter="False">
即使我尝试了CONVERT功能,我也有同样的错误! 那么有人能让我感到高兴吗?