使用LINQ在csharp中使用out参数调用storedProcedure [英] Calling storedProcedure with out parameters in csharp using LINQ

查看:171
本文介绍了使用LINQ在csharp中使用out参数调用storedProcedure的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个存储过程,它会rweturn一个char变量

在使用LINQ概念在csharp中调用SP时出现错误.

Hi
I have a stored procedure which rweturns a char variable

I am getting error in calling the SP in csharp with LINQ concept.

sp:sp_Sample<br />


我宣布


I declared

System.Nullable<char> outx=null;<br />
</char>



然后我在代码背后将sp称为



And I called sp in codebehind as,

sp_Sample(ref outx)<br />


但这对我不起作用.
谁能告诉我使用LINQ调用SP返回char参数的正确方法.


预先感谢.


But it is not working for me.
Can anyone tell me the correct way of calling SP returning a char parameter using LINQ.


Thanks in advance.

推荐答案

不知道是什么问题,但是在ADO .NET中很容易
Don''t know what the problem is, but it is easy in ADO .NET


您是否设置了连接字符串?该字符串连接吗?
确保您能够连接到数据库.
Have you setup a connection string? Is that string connect?
Make sure you are able to connect to the database.


这篇关于使用LINQ在csharp中使用out参数调用storedProcedure的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆