Code Snippet
ALTER PROCEDURE dbo.SelectHWCategoryBased
(
@.title varchar /* Like Processor/RAM */
)
AS
SELECT Hardwares.HWID, Hardwares.Title
FROM Hardwares INNER JOIN
Category ON Hardwares.CategoryID = Category.CategoryID
WHERE (Category.Type LIKE '%Hardware%') AND (Category.Title = @.Title)
There is no issue on your SP.
You have to use the SQLDataAdapater to fill the dataset. Use the current command object as SelectCommand of the Adapter & call the Fill() method.. Check with ADO.NET forum
|||
@.title varchar /* Like Processor/RAM */
The default size for an incoming varchar parameter is one character. If your incoming parameter value is longer than one character, it is being truncated, and the WHERE clause is looking for a Category.Title that matches the single character.
Probably won't find one.
Change the parameter to varchar(n) -n being sized appropriate to your Title field.
|||Thanks, that works, missed out that.
No comments:
Post a Comment