asp.net执行储存过程 - .NET技术 / ASP.NET
这是我sql储存过程的代码
SQL code:
select * from users
insert into users values('xjs','xjs','禁药')
create proc useproc
@msg varchar(50)
as
begin
set @msg = (select use_nc from users where use_name='xjs')
print @msg
end
drop proc useproc
declare @msg varchar(50)
exec useproc @msg
在sql2005中执行结果是:“禁药”
下面是我在c#中的代码
C# code:
SqlConnection conn=new SqlConnection(sConn);
SqlDataAdapter da = new SqlDataAdapter();
SqlParameter param = new SqlParameter();
da.SelectCommand = new SqlCommand();
conn.Open();
da.SelectCommand.Connection = conn;
da.SelectCommand.CommandText = "useproc";
da.SelectCommand.CommandType = CommandType.StoredProcedure;
param = new SqlParameter("@msg", SqlDbType.VarChar);
param.Direction = ParameterDirection.Input;
param.Value = Convert.ToString("msg");
da.SelectCommand.Parameters.Add(param);
object msg = da.SelectCommand.ExecuteScalar();
我的意思就是想要输出上面SQL中的“禁药”,单是我没做到,object msg = da.SelectCommand.ExecuteScalar();这句话返回的对象是null。我不知道该怎么做。请问下大家。谢谢
C# code
相关问答:
function CheckOpwd(){//验证用户名
var pwd=document.all.txtOpwd;
var div1=document.getElementById("divPwd");
if (pwd.value=="")
{
......
C# code:
SqlConnection conn = CsDB.sqlcon();
SqlDataAdapter da = new SqlDataAdapter("select fwCoding from bjmuma_fwCoding where OrderNumber='" + Order + & ......
万网的服务器支持伪静态的,直接用rewrite在web.config文件写规则,也不用安装组件就可以实现伪静态,但是在时代互联服务器就用不了了,咨询它的客服,他说他们服务器(基本型C)不支持伪静态的.请问一下各位我该用什么方法 ......
本人工作经验一年以上
熟悉asp.net
熟悉javascript
熟悉Css
熟悉ajax
熟悉sqlserver2005
有一年的项目经验
具体项目和其他的就不在这写了
有意者联系:
QQ:359233910
引用
本人工作经验一年以上
熟悉asp ......
1.asp.net做的一个答题页面,如何实时限时后自动提交,请大家给点思路
限时的时间信息存放在数据库中
2.如果答题时间设置的较长,如何方式session超时后页面无效
谢谢
用js方法来控制
回复内容太短了。。
js ......