SubSonic Forums
All Your Database Are Belong To Us

Where() question

Latest post 11-08-2008 4:29 PM by smiggleworth. 2 replies.
  • 11-07-2008 11:24 AM

    Where() question

    Hello,

    I have a query that has an problem with the "Where()"

                   qry = new Select(columns)

                        .From(FormField.Schema)

                        .InnerJoin(TaskForm.Schema)

                        .LeftOuterJoin(TaskFormValue.Schema)

                        .Where(TaskForm.Columns.TaskFormId).IsEqualTo(sectionFormId.ToString())

                        .OrderAsc(FormField.Columns.FieldOrder);

    The column "TaskFormId" is in both "TaskForm" & "TaskFormValue" tables. The problem is that when the sql hits the server the column "TaskForm.Columns.TaskFormId" is chopped down to just "TaskFormId" and throws an "Ambiguous column name" error.

    So how to I get it to pass "TaskForm.TaskFormId" to the sql server?

     

  • 11-07-2008 12:20 PM In reply to

    Re: Where() question

    Reply |Contact |Answer

    Try this

    .Where(TaskForm.TaskFormIdColumn).IsEqualTo(sectionFormId.ToString())

    If I am I because I am I, and You are You because You are You, then I am I, and you are you. But If I am I because You are You, and You are You because I am I, then I am not I and You are not You. -Rabbi of Kotzk

  • 11-08-2008 4:29 PM In reply to

    Re: Where() question

    Brilliant! That worked perfectly.

Page 1 of 1 (3 items) | RSS