我正在 GridView 中执行搜索。问题是当我打开默认页面时,它不显示任何数据,而实际上有数据。但是当我执行搜索功能时,它会显示数据。我正在使用过滤器表达式按名字列在 Gridview 中搜索记录。当我取出 FilterExpression 位时,它显示正常,但是当我将其添加回来时,它什么也不显示,但搜索仍然有效。
< asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ConnectionStrings:SDAppDBsConnectionString2 %>"
UpdateCommand="UPDATE PatInfo SET FirstName = @FirstName,
LastName = @LastName, MiddleInitial = @MiddleInitial, HomeAddress = @HomeAddress,
PhoneNumber = @PhoneNumber, Gender = @Gender, DOB = @DOB, SSN = @SSN WHERE (ID = @ID)"
DeleteCommand="DELETE FROM PatInfo WHERE (ID = @ID)"
SelectCommand="select * from [PatInfo]"
FilterExpression="FirstName LIKE '%{0}%'" >