Hey alqous,

Can I ask why you are using a case statement in the above code?

You are using the exact same query in each case with the exception of the survey ID. Why not use a parameter in the query string, and the value of that parameter will be ddlquestionnaire.SelectedIndex.

Related to that, you are concatentating the SQL string and building up the SQL string, this really should be avoided as it leaves you open to SQL Injection. To prevent this, you should always use parameterized queries. You can find an example of how to do this in this thread:

http://www.vbforums.com/showthread.php?t=469872

Hope that helps!!

Gary