Thanks Siper, I already did that (adding '%' + at front), it didn't made any difference. I think, the problem is not with the query, bcoz when I tested it in "Query Builder" it worked with individual FName search or LName search. Not sure why its failing when I run the code, may be there is some problem with Gridview. But again I don't even get any error message ?
Courses INNER JOIN Registrants ON Courses.Course_Id = Registrants.Course_Id INNER JOIN Course_Names ON Courses.Course_Name_Id = Course_Names.Course_Name_Id WHERE (Registrants.Registrant_F_Name LIKE @Registrant_F_Name + '%') OR (Registrants.Registrant_L_Name LIKE @Registrant_L_Name + '%') ORDER BY Registrants.Registrant_Id DESC
@punits11 The only thing I see different than my video is that you didn't put a wildcard ('%') in the beginning of the parameter. Although I don't see why that should make a difference. Maybe try putting in the wildcard in the beginning as well and see if that helps ( LIKE '%' + @Registrant_F_Name + '%'). Make sure to rebuild your website before running it. Other than that, stackoverflow is the best forum in the world.
@punits11 Also, I don't think the parentheses are necessary (Registrants.Registrant_F_Name LIKE @Registrant_F_Name + '%') . Just to make sure they're not causing the problem, try taking them out.
@punits11 I can't really help u without looking at your code. The only thing that comes to mind of hand is that you may have written your query with an "and", not with an "or". If that's not the problem, post your sql query as a comment so I can look at it.
Firstly I want to thank you for the wonderful tutorial but their is quite some problem which i love for you to address. After creating the search box the sorting, editing,selection,paging,updating and canceling controls no longer work for the GridView especial when you are using a large data source. I would love to see this issued solved because I have been having quite a deal of problem solving the situation. I still can't get sorting and updating to work.
Siper, It finally worked .... U know what I did .....
Under the 'SelectParameters' I added
DefaultValue="NULL" for both Textboxes (First & Last Name)
It has been making me mad since last night. What a simple fix it was ....
punits11 1 month ago
@punits11 Great. Thanks for sharing.
SiperEnergy 1 month ago
Thanks Siper, I already did that (adding '%' + at front), it didn't made any difference. I think, the problem is not with the query, bcoz when I tested it in "Query Builder" it worked with individual FName search or LName search. Not sure why its failing when I run the code, may be there is some problem with Gridview. But again I don't even get any error message ?
punits11 1 month ago
Just FYI: The query works perfectly when I test it in "Query Builder".
punits11 1 month ago
Part 2: ........
Courses INNER JOIN Registrants ON Courses.Course_Id = Registrants.Course_Id INNER JOIN Course_Names ON Courses.Course_Name_Id = Course_Names.Course_Name_Id WHERE (Registrants.Registrant_F_Name LIKE @Registrant_F_Name + '%') OR (Registrants.Registrant_L_Name LIKE @Registrant_L_Name + '%') ORDER BY Registrants.Registrant_Id DESC
punits11 1 month ago
@punits11 The only thing I see different than my video is that you didn't put a wildcard ('%') in the beginning of the parameter. Although I don't see why that should make a difference. Maybe try putting in the wildcard in the beginning as well and see if that helps ( LIKE '%' + @Registrant_F_Name + '%'). Make sure to rebuild your website before running it. Other than that, stackoverflow is the best forum in the world.
SiperEnergy 1 month ago
This has been flagged as spam show
@punits11 Also, I don't think the parentheses are necessary (Registrants.Registrant_F_Name LIKE @Registrant_F_Name + '%') . Just to make sure they're not causing the problem, try taking them out.
SiperEnergy 1 month ago
Its lengthy, so I am posting it in 2 parts ....
Part 1: .......
SELECT Course_Names.Course_Name, Courses.Course_Start_Date, Courses.Course_End_Date, Registrants.Registrant_Id, Registrants.Registrant_F_Name, Registrants.Registrant_L_Name, Registrants.Registrant_B_Title, Registrants.Registrant_Agency, Registrants.Fee_Amount, Registrants.Payment_Status FROM
punits11 1 month ago
Does NOT work when I search on only one name. FName or LName
When I add both, it works.
Any idea what wrong I may be doing ?
punits11 1 month ago
@punits11 I can't really help u without looking at your code. The only thing that comes to mind of hand is that you may have written your query with an "and", not with an "or". If that's not the problem, post your sql query as a comment so I can look at it.
SiperEnergy 1 month ago
Comment removed
punits11 1 month ago
I currently have a page that has a button that opens a "Search Page"
I use the above example to choose one of the items in the grid.
How would I select 1 of the items in the grid view and fill a text box on The main page ???
Thanks for all your help
JTMan401 1 month ago
hi sir thanks soooooooooo much Really your tutorial great it solve my all problems thanks again.
manjeet762 2 months ago
Thanks
JinzUtAreZ 3 months ago
Firstly I want to thank you for the wonderful tutorial but their is quite some problem which i love for you to address. After creating the search box the sorting, editing,selection,paging,updating and canceling controls no longer work for the GridView especial when you are using a large data source. I would love to see this issued solved because I have been having quite a deal of problem solving the situation. I still can't get sorting and updating to work.
smugs2cheche 5 months ago
thank you so much
MrPopy2006 5 months ago in playlist Data Base
the error message is when itry to search is :
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints
MrPopy2006 5 months ago in playlist Data Base
SELECT Categories.CategoryID, Categories.CategoryName, Categories.Description, Products.ProductID, Products.ProductName, Products.CategoryID AS Expr1, Products.UnitPrice, Products.UnitsOnOrder
FROM Categories INNER JOIN Products ON Categories.CategoryID = Products.CategoryID
WHERE (Categories.CategoryName LIKE '%' + @CategoryName + '%')
ORDER BY Categories.CategoryID, Categories.CategoryName
MrPopy2006 5 months ago in playlist Data Base
nice work
sr i been try to search form two tables but it dose not work
like in text box CategoryName : BRV
and i i have inner join in my tabel thsi is the table code in the dataset :
MrPopy2006 5 months ago in playlist Data Base