Subsonic, setting useSPs=“true” doesn't seem to work. SPs aren't being generated

老子叫甜甜 提交于 2019-12-10 12:09:01

问题


I am using subsonic, I'm reasonably new at it. Today is the first time I need to use stored procedures with it.

My provider line in the webconfig is as follows:

I am using two providers pointing at two different databases, where the other one isn't calling the SPs.

When I generate, I am getting all the tables and the class storedprocedures's but it is empty! So when I do SPs. ... in code there are no classes to display.

Does anyone know what's happening here?

UPDATE:

If I set UseSps="True" on my other provider.. it does work?

The databases are on completely different servers..

Bex


回答1:


I'm assuming you're using version 2.X of subsonic, not 3 ?

If so, you need to tell your config to generate stored procs, something like this:

 <SubSonicService defaultProvider="blah">
        <providers>
            <clear />
            <add 
 ...
 includeProcedureList="proc1,proc2"

If you're using version 3 you just need to run the T4 template for stored procs.




回答2:


Right- for anyone who's got this problem.. I know what's causing it (in my case anyway).. will need a core code rewrite to fix..

If you go here it shows the source for generating the Sps. Go to line 1745

If I run this procedure in SQL Server I get this error:

Cannot sort a row of size 8098, which is greater than the allowable maximum of 8094.

Its because the stored procedures in the DB I am using are absolutely massive, so they are too long for the row when it orders by. Removing the order by in the core code will fix that error, but I don't know if it's needed??

I am going to submit it as an issue.



来源:https://stackoverflow.com/questions/3253828/subsonic-setting-usesps-true-doesnt-seem-to-work-sps-arent-being-generated

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!