Hi,
I'd suggest you run the query string directly in SQL Database to make sure the query is correct. For Accessing Data with ASP.NET, you can refer to:
ASP.NET Data Access
http://msdn.microsoft.com/en-us/library/6759sth4(v=vs.100).aspx
As this is an ASP.NET question, it is recommended you get further support at ASP.NET forum. The engineers and community members there have more experience can help you in a more efficient way. Thanks for understanding!
Leo Tang [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.