Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi all..

I am using query builder to build a query for reporting purpose. The problem that i am facing is that i am unable to cast string to integer inside query builder.
please tell me how to do this??

i tried
WHERE  ((unqId = CONVERT(int, @unqId))


i also tried
where (unqId = (int)@unqId)


i also tried
Where (unqId= Int.Parse(@unqId))


but every time it's showing me either error or null value

however if i remove the where clause it's showing me the whole report as expected..
Posted
Updated 27-May-12 21:45pm
v3

1 solution

C#
WHERE UNQID = @UNQID

In the parametrized query
oCommand.Parametrized.AddWithValue("@UNQID",Convert.Int32(string_name));
 
Share this answer
 
Comments
ujjwal uniyal 28-May-12 3:38am    
i am using dataset (.xsd file) Passing parameters to report Using Object Data Source

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