Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi!

here is my querry where i am passing two integers variables

its not executing and when i pass two integers values the it execute

whats the problem
("SELECT [val1] FROM [asd].[dbo].[asede] where md_int = myInt1 AND rd_int = myInt2)

but when i pass values its workin properly
SELECT [val1] FROM [asd].[dbo].[asede] where md_int = 1 AND rd_int = 2)
Posted
Updated 24-Jul-11 22:44pm
v2
Comments
Prerak Patel 25-Jul-11 4:49am    
Are you doing this in procedure? If yes, share the procedure code.
kami124 25-Jul-11 4:53am    
no its just a querry, i am doing this in c sharp

1 solution

If you are passing variables you have to pass it in this way.
("SELECT [val1] FROM [asd].[dbo].[asede] where md_int = " + myInt1+ " AND rd_int = " + myInt2)
 
Share this answer
 
v2
Comments
kami124 25-Jul-11 4:56am    
ok its perfect
thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900