in

CodeSmith Community

Your Code. Your Way. Faster!

SP for Views in a different schemas aren't called correctly

Last post 05-22-2008 7:59 PM by blake05. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-12-2008 12:48 PM

    SP for Views in a different schemas aren't called correctly

    Hi,

    I'm using .netTiers 2.2.0 rev 705 and there is a problem with the generated code when you have a View that belongs to a different schema that dbo. The procedure code its OK, but the code that calls the procedure in application omits the schema of the procedure, causing errors.

    So, based on file SqlEntityProviderBase.generated.cst, I made some corrections in file .\DataAccessLayer.SqlClients\Views\SqlEntityViewProviderBase.generated.cst to prevent these errors:

    In the beggining: 

        //Get the owner of the table
        string owner = GetOwnerName(SourceView, true);

    And every time when procedure is called, just add the owner varible. Example:

        DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "<%=owner + ProcedurePrefix + GetCleanName(name) + SelectSuffix +        SelectAllSuffix%>", _useStoredProcedure); 


    I hope this can be useful. By the way, thanks very much for .netTiers template!


    André
     

    • Post Points: 35
  • 05-22-2008 7:59 PM In reply to

    • blake05
    • Top 25 Contributor
    • Joined on 04-03-2008
    • Wisconsin
    • Posts 166
    • Points 2,790

    Re: SP for Views in a different schemas aren't called correctly

     Hello,

    Thank you for your contribution, we have added this to our to-do list. You can check the status of this here

    Thanks

    -Blake

    Blake Niemyjski
    CodeSmith Tools, LLC
    Support Specialist
    • Post Points: 5
Page 1 of 1 (2 items)
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems