W
WISEMANOFNARNIA
I have a grid view that is dependent on a textbox. If the user types
the letter 'T' in the textbox, it will find all firstnames that begin
with that letter.
If the user types nothing in that textbox, He should find all names,
no matter what they start with.
The gridview is also dependent on some checkboxes. The asp.net
parameter calls these boolean, and in my storedprocedure (that fills
the grid) I call them 'bit'.
I'm finding that the gridview will populate only if I enter at least
one letter in the textbox. If I leave it blank, the gridview does not
populate. In fact, it looks like the stored procedure does not even
get to the first line when this happens.
The relevant parts of the stored procedure look like this:
ALTER PROCEDURE [dbo].[FillFormHistoryGrid]
@FirstName varchar(20) ='',
@LastName varchar(25) = '',
@IncludeApprovals bit = 0,
@IncludeDenials bit = 0,
@IncludeNoDecision bit = 0,
@StartDate datetime, @EndDate datetime, @Agency varchar(50)
AS
BEGIN
FROM MyTable
Where (len(@FirstName) = 0 or fname like @FirstName + '%') and
(len(@LastName) = 0 or lname like @LastName + '%') and
Has anyone run into this before?
Thanks,
Marv
the letter 'T' in the textbox, it will find all firstnames that begin
with that letter.
If the user types nothing in that textbox, He should find all names,
no matter what they start with.
The gridview is also dependent on some checkboxes. The asp.net
parameter calls these boolean, and in my storedprocedure (that fills
the grid) I call them 'bit'.
I'm finding that the gridview will populate only if I enter at least
one letter in the textbox. If I leave it blank, the gridview does not
populate. In fact, it looks like the stored procedure does not even
get to the first line when this happens.
The relevant parts of the stored procedure look like this:
ALTER PROCEDURE [dbo].[FillFormHistoryGrid]
@FirstName varchar(20) ='',
@LastName varchar(25) = '',
@IncludeApprovals bit = 0,
@IncludeDenials bit = 0,
@IncludeNoDecision bit = 0,
@StartDate datetime, @EndDate datetime, @Agency varchar(50)
AS
BEGIN
FROM MyTable
Where (len(@FirstName) = 0 or fname like @FirstName + '%') and
(len(@LastName) = 0 or lname like @LastName + '%') and
Has anyone run into this before?
Thanks,
Marv