0
private void BuildGridView2()
{
    GridView1.DataSource = new Select()
    .From("NewsReleases")
    .Where("RelMonth").IsEqualTo(this.ddlAward.SelectedValue)
    .And("RelYear").IsEqualTo(this.ddlYear.SelectedValue)
    .OrderAsc("RelDate")
    .ExecuteDataSet();

 }

The SQL statement above is not working for some reason. Is there a way to write the output of the staement to to the page to see what is happening?

I tired the following but got an error:

Response.Write(
    new Select()
        .From("NewsReleases")
        .Where("RelMonth").IsEqualTo(this.ddlAward.SelectedValue)
        .And("RelYear").IsEqualTo(this.ddlYear.SelectedValue).ToString()
);
3
  • 2
    Where does your class Select come from? Commented Nov 17, 2009 at 22:33
  • @Brett: What error do you get? Commented Nov 17, 2009 at 22:38
  • stackoverflow.com/questions/799953/… Please re-read the answer ranomore gave you Brett. Commented Nov 18, 2009 at 9:50

2 Answers 2

3

Use SQL Profiler. It allows you to see the actual SQL query being sent to the database.

It comes with SQL 2005/2008 client tools.

Sign up to request clarification or add additional context in comments.

Comments

2

I'm not familiar with Subsonic, but according to this question you may be able to use the BuildSqlStatement() method of your query to see the generated SQL.

1 Comment

Yes BuildSqlStatement should do what he wants.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.