1

Topic: Procedure of search from a text box

Hello, how to implement
command-> CommandText = "SELECT * FROM contacts WHERE (name LIKE?)";
command-> Parameters-> Add ("name", "%" + textBox1-> Text + "%");

By means of stored procedures?

2

Re: Procedure of search from a text box

voxpert;
And what it is impossible, or you think, what all understand your bird's language in the first post?

3

Re: Procedure of search from a text box

voxpert wrote:

how to implement
By means of stored procedures?

by means of dynamic sql

4

Re: Procedure of search from a text box

I want that that type of it
ALTER PROCEDURE dbo. StoredProcedure1
AS
SELECT * FROM contacts WHERE (name LIKE?);
"name", "%" + textBox1-> Text + "%";
RETURN
It is necessary to carry out search in the table contacts - a field with a name, and at letter input in a text box c ++ and to produce a name of contacts

5

Re: Procedure of search from a text box

WarAnt;
It CLR with ++, I use it and SQL

6

Re: Procedure of search from a text box

voxpert wrote:

I want that that type of it
ALTER PROCEDURE dbo. StoredProcedure1
AS
SELECT * FROM contacts WHERE (name LIKE?);
"name", "%" + textBox1-> Text + "%";
RETURN
It is necessary to carry out search in the table contacts - a field with a name, and at letter input in a text box c ++ and to produce a name of contacts

ALTER PROCEDURE dbo. StoredProcedure1
@name varchar (255)
AS
SET @name = ISNULL (@name, ")
SET @name = IIF (LEFT (@name, 1) = CHAR (34), ", CHAR (34)) + @name
SET @name = @name + IIF (RIGHT (@name, 1) = CHAR (34), ", CHAR (34))
SELECT * FROM contacts WHERE [name] LIKE @name
RETURN 0

7

Re: Procedure of search from a text box

felix_ff;
And how to connect c ++, to take name from textbox?

8

Re: Procedure of search from a text box

voxpert wrote:

felix_ff;
And how to connect c ++, to take name from textbox?

on with ++  separate a forum .