SubSonic Forums
All Your Database Are Belong To Us

"as" in select statement

Latest post 07-29-2008 9:52 AM by dsapala. 0 replies.
  • 07-29-2008 9:52 AM

    "as" in select statement

    Guys, how can I do a select statement in subsonic like this:

    select OneTable.ID as [ID One], OneTable.Name as [Name One], TwoTable.ID as [ID Two], TwoTable.Name as [Name Two]

    from OneTable

    inner join TwoTable on

    OneTable.ID = TwoTable.OneTableID

     

    I tried this:


                using (IDataReader rdr = DB.Select("OneTable.ID [ID One], OneTable.Name [Name One], TwoTable.ID [ID Two], TwoTable.Name [Name Two]")
                    .From(OneTable.Schema.TableName)
                    .InnerJoin(OneTable.Schema.TableName, OneTable.Columns.ID, TwoTable.Schema.TableName, TwoTable.Columns.OneTableID)

     

    I'm having trouble with the "as" in the select

    Filed under: , ,
Page 1 of 1 (1 items) | RSS