Link to home
Start Free TrialLog in
Avatar of Bastyon
Bastyon

asked on

c# sql cmd.Parameters.AddWithValue(); for values other than '='

I am able to add values I do thing like this.

cmd.Parameters.AddWithValue(paraname, paravalue);    and by default this behavior create a sql query of '='

for example   Select * from tbl where col_a = @col_a

if @col_a is 5

to put into a parameter

cmd.Parameters.AddWithValue(@col_a, 5);

but what woud I do if I didnt want it to be '='

for example

How would I add a int parameter for >   or for <>?

How would I add a parameter for LIKE in a string ?

How would I add a parameter for Is Not Null?
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial