在mvc项目中使用specefic函数 [英] use specefic function in mvc project
本文介绍了在mvc项目中使用specefic函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在申请之前,我使用了一个功能。我把它添加到我的sqlserver - >数据库 - >程序性--->功能--->比例值函数
before in application , i used a function . i add it to my sqlserver --> database --> Programmabality ---> Function ---> Scalered-Value Function
dbo.MyFunc(_txt.text);
但现在我需要在我的项目中使用此功能。它的mvc4网站。有可能这样使用吗?我应该在哪里添加这个功能?当然我喜欢应用程序,但db.MyFunc()在我的课程中无法识别。
所以,我的项目是CodeFirst。
but now i need this function in my project . its mvc4 web site . is it possible to use like that ? and where i should add this function? of course i did like application , but db.MyFunc() dose not recognize in my class.
so,my project is CodeFirst .
推荐答案
你不要像这样调用C#中的SQL函数。
查看以下链接以了解如何操作。
http://stackoverflow.com/questions/1300052/how-can-i-call-a-sqlserver-function-from-vb- netor-c-is-there-some-syntax-li / 3232556#3232556 [ ^ ]
顺便说一句,这是基本的,我建议你买一本好的c#书并阅读。
You do not call a SQL function from C# like this.
Look at the following link to see how to do it.
http://stackoverflow.com/questions/1300052/how-can-i-call-a-sqlserver-function-from-vb-netor-c-is-there-some-syntax-li/3232556#3232556[^]
Btw, this is basic and I would suggest you to buy a good c# book and read it.
这篇关于在mvc项目中使用specefic函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文