We would need a lot more details to help you out.
What is "In running my program", what is my program? A Flex Viewer? If so, what version? What version ArcGIS for Server?
"Unable to perform query. Please check your parameters."
Well I'd say your problem is your input parameters.
Opened the map service? What does this even mean?
First thing I'd do is check your ArcGIS Server logs.