tags:

views:

53

answers:

1

Having added the subsonic 2.2 subcommander sonic.exe as an external tool I can generate my DAL classes in my defined \dataaccess\generated\ folder but when I build the project I get an error in the following file:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\subsonictest\bdf9ac02\aff68c1c\App_Code.2ygn7ole.0.cs in the following:

Code:

/// <summary>
/// Creates an object wrapper for the iData_sp_GenerateDataSQL Procedure
/// </summary>
public static StoredProcedure IDataSpGenerateDataSQL(string TABLE, string IDENTITYCOL)
{
  SubSonic.StoredProcedure sp = new 
      SubSonic.StoredProcedure("iData_sp_GenerateDataSQL", 
                               DataService.GetInstance("KLA"), 
                               "PUZZLE\mnolan");        
  sp.Command.AddParameter("@TABLE", TABLE, DbType.AnsiString, null, null);       
  sp.Command.AddParameter("@IDENTITYCOL", IDENTITYCOL, DbType.AnsiString, null, null);
  return sp;
}

The error message is - error CS1009 Unrecognized escape sequence and shows the error is associated with the PUZZLE\mnolan string. I can escape the sequence with '\' but this won't help because this is a temporary build file and is regenerated.

Thanks for the help,

Mike

+2  A: 

Try :

@"PUZZLE\mnolan"

Backslashes are special characters in C# strings. The @ tells C# to treat them literally. You could double the backslash instead.

David Gladfelter
Yeah PUZZLE\mnolan is my login to the puzzle domain used to login to the PC used for the build. I have tried the @ prefix and the \\ with same error.
Mike
Sorry to hear that. You'll either have to fix the tool that generates the code or post-process it with a scripting tool like Windows Powershell or python before compiling it.
David Gladfelter
I have removed the sp [PUZZLE\mnolan].[iData_sp_GenerateDataSQL] that was causing the issue (it is not required) and the build now fails in the temp file App_Code.mbu5qmhf.0.cs at:public KLA.FavouriteCollection Favourites() { return new KLA.FavouriteCollection().Where(Favourite.Columns.ProductID, ProductID).Load(); }with error CS0117 - bool does not contain a definition for columns. This is in the ActiveRecord class which wraps the Products table.Is this a problem with the Products schema?
Mike