我存储过程中用的是@@identity想得到刚刚插入数据的id
在后台我的代码是
SqlParameter id = new SqlParameter("@id",SqlDbType.Int);
id.Direction = ParameterDirection .Output;
comm .Parameters .Add(id);
conn.Open();
comm .ExecuteNonQuery();
conn.Close();
Object Outputid = comm.Parameters["@id"].Value.ToString();
this.Txtid .Text = id.ToString();但页面显示的结果是@@identity
请各位指点我怎么显示id啊!
在后台我的代码是
SqlParameter id = new SqlParameter("@id",SqlDbType.Int);
id.Direction = ParameterDirection .Output;
comm .Parameters .Add(id);
conn.Open();
comm .ExecuteNonQuery();
conn.Close();
Object Outputid = comm.Parameters["@id"].Value.ToString();
this.Txtid .Text = id.ToString();但页面显示的结果是@@identity
请各位指点我怎么显示id啊!
解决方案 »
- m_CustomerList m_customerList which one is best normalise?
- 关于YetAnotherForum论坛源代码
- 如何标记权限?
- 关于{0:c}的问题
- 用户控件由一个个LinkButton组成,而且有子菜单,在页面上时占的空间太大怎么办?
- webclient中怎样使用post方法??
- ■问个关于 【统计html网页点击数】 和 【区分中英文 进行 字符串 长度限制】的问题.■
- bitsbird(一瓢 单身走我路),请进来。
- “/”应用程序中的服务器错误(自己的服务器)
- 求救大神,有木有ajax,JQuery的基础案例..在那有啊?
- 问个简单问题:asp.net文件为什么叫aspx?
- 为什么说.net中的事件驱动模型是模仿的,那真正的事件驱动又是怎样的呢?
(
@outputid int output,
@paraname1 type,
@paraname2 type
)
as
insert into tablename(section1,section2) values()
select
@output=@@identity
go