Here is my stored procedure:
ALTER PROCEDURE sp_searchedstudentrecords
(
@condition varchar(20),
@searchtext varchar(50),
@searchclass int
)
AS
begin
If (@condition = 'startswith')
select * from student where name like @searchtext+ '% '
else if (@condition = 'endswith')
select * from student where name like '%' +@searchtext
else
select * from student where name like '%' +@searchtext+ '%'
End
I have been added extra one text box for search by class with the above query.
@searchclass int
May i now what should be the query for search by class look like?
I'm new sql query and .net,
I have been created dropdown contains startswith,endswith and contains and one text box for search by name.
I already done select record where search by name, with this i need to select record from table where search by class.
Can anyone guide me for query?
Thanks,