CodeSmith Community
Your Code. Your Way. Faster!

My Custom StoredProcedures are not returning TList<Entity>

Latest post 01-22-2007 1:48 PM by drodecker. 6 replies.
  • 11-29-2006 6:15 AM

    • croco
    • Not Ranked
    • Joined on 11-09-2006
    • Posts 4
    • Points 140

    My Custom StoredProcedures are not returning TList<Entity>

    Hello guys,

    This seems to be weird issue but I cannot get my custom StoredProcedure to return collection I am still getting default DataReader.

    I have tried nearly everything:

    I prepared _tblAddress_GePagedTest SP and copyied all SQL code from existing generated (byCodeSmith 4.0) SP named dbo.tblAddress_GetPaged just for test - it is just selecting fields (all) from tblAddress table but for my generated code I am always getting default DataReader.

    I tryed also to re-open CodeSmith to refresh schema but still without success.

    Also noticed that custom stored procedures are not generated for my service layer is this feature available?

    Does anybody experience this issues?

    Thanks

    Carl  

    • Post Points: 35
  • 11-29-2006 8:12 AM In reply to

    • swin
    • Top 10 Contributor
    • Joined on 06-14-2006
    • London, UK
    • Posts 924
    • Points 34,750

    Re: My Custom StoredProcedures are not returning TList<Entity>

    If you just did a "Cut and paste" from an auto generated proc you probably also included the last statement "Select @@ROWCOUNT".  If you did remove it!

    For NT to be able to match your Select to your business entity automatically the business data must be the only returned dataset.

    Your custom procs should be available in your service layer if they are picked up by the data layer.

    HTH

    swin

    ------------------------------------------------- Member of the .NetTiers team -------------------------------------------------
    • Post Points: 35
  • 11-30-2006 2:45 AM In reply to

    • croco
    • Not Ranked
    • Joined on 11-09-2006
    • Posts 4
    • Points 140

    Re: My Custom StoredProcedures are not returning TList<Entity>

    swin, thanks for advice.

    But I tried that as well and my current custom sproc is nothing else just select [field1],... [fieldN] from TableName (but still getting DataReader generated on output)

    Is there something hidden in option that I ommited, or is this is something like application CodeSmith generator error that cannot recognize clean business class somehow?

    Thanks

    Carl  

    • Post Points: 65
  • 11-30-2006 5:25 AM In reply to

    • DavidB
    • Not Ranked
    • Joined on 09-28-2006
    • Posts 5
    • Points 145

    Re: My Custom StoredProcedures are not returning TList<Entity>

    Do you have any User Defined Datatypes in your table? These will cause NetTiers to give a dataset insetad of a TList. You need to replace them with the native data type. You can do this with ALTER TABLE xxx ALTER COLUMN xxx in SQL Server 2005.

    We now have 2 databases - one we use for generation that has no data (except Enum tables), only the relationships and indices we want to appear in code, custom sprocs and no UDTs. The other database is our normal database.

     

    • Post Points: 35
  • 11-30-2006 6:50 AM In reply to

    • swin
    • Top 10 Contributor
    • Joined on 06-14-2006
    • London, UK
    • Posts 924
    • Points 34,750

    Re: My Custom StoredProcedures are not returning TList<Entity>

    Carl,

    Are you 100% sure all columns returned EXACTLY match the columns in the table.  This includes their order, type, size etc.

    For example I had a csp which I needed to just drop an image column - to get NT to pick this null column up and give me a TList had had to cast a null to image.

    HTH

    swin

    ------------------------------------------------- Member of the .NetTiers team -------------------------------------------------
    • Post Points: 35
  • 11-30-2006 7:32 AM In reply to

    • croco
    • Not Ranked
    • Joined on 11-09-2006
    • Posts 4
    • Points 140

    Re: My Custom StoredProcedures are not returning TList<Entity>

    Thanks DavidB,

    It was EXACTLY that problem I had. I have been using UDT and this was causing that problem. Now it's resolved and finally it's working.

    Thanks guys!!!

    Cheers 

    • Post Points: 5
  • 01-22-2007 1:48 PM In reply to

    • drodecker
    • Not Ranked
    • Joined on 01-22-2007
    • Fountain Valley
    • Posts 1
    • Points 5

    Re: My Custom StoredProcedures are not returning TList<Entity>

    Can you confirm that Custom Stored Procedures only return a structured recordset <list> if they exactly represent an underlying table?



    • Post Points: 5
Page 1 of 1 (7 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems