SubSonic Forums
All Your Database Are Belong To Us

Edit: Not a bug. Bug when building the Sql Statement see details

Latest post 09-04-2008 9:12 AM by GeoffAtDatagaard. 1 replies.
  • 09-04-2008 7:13 AM

    Edit: Not a bug. Bug when building the Sql Statement see details

    Edit: Ok, aparently it's ain't a bug, just the way it's supposed to work!

    You build the sql first and only after that you provide the parameters!

     

     

    Running the code below generates the following Exception: Must declare the scalar variable "@ID0".

    ---------------------------------------------

    string sql1 = myRepository.DB.Select().From(myName.Schemas.myTable).Where("ID").IsEqualTo(1).BuildSqlStatement();

    StringBuilder sb = new StringBuilder();

     sb.AppendLine(sql1);

     string sql = sb.ToString();

    new InlineQuery().Execute(sql);

    ---------------------------------------------

    Strangely enough when changing the last line to new InlineQuery().Execute(sql, 1);

    It works  well. But this is obviously an error as we already have specified @ID in the very first line.

    Filed under:
  • 09-04-2008 9:12 AM In reply to

    Re: Edit: Not a bug. Bug when building the Sql Statement see details

     Dont feel alone, I spent a while trying to look for this "bug" too.

     

Page 1 of 1 (2 items) | RSS