
I Want To search On Word(Text Box) in Selected Combo Box Item(field in DataBase) ,
my Store procedure is :
USE [QueueDB]
GO
/****** Object: StoredProcedure [dbo].[SP_SelectDriver_ByNameAndField] Script Date: 09/07/2012 17:20:24 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[SP_SelectDriver_ByNameAndField]
@Word nvarchar(100),
@Field nvarchar(100)
AS
BEGIN
select * from Driver where @Field like + N'%' + @Word + '%'
END
it does not work , what way you suggest to do this search method ?
Azize del,
ComboBox hamishe baiangare LookUp ast ke hamanande Table eist ke 2 sotoune Id va Describer darad. Agar gharar ast ke meghdare entekhabie ComboBox be StoredProcedure ferestade beshe, pishnahad mikonam az Id e Bind shode be SelectedValue e ComboBox estefade beshe. Nvarchar ro be SP ferestadan kare dorosti nist.
Dear Sir/Madam,
ComboBox is always a replacement for LookUp in Information Systems that is like a Table that has only two columns, Id and Describer. If you’re about to send the SelectedValue of ComboBox to your StoredProcedure, I suggest to send the bound value of SelectedValue as an integer to it. Then you have many options to write your query. Sending a LookUp value by using Nvarchar might have many side effects in the future of your application (it has many issues with collation in comparison).
Cheers
Change Code to this:
Also you can use another way: