Kevin

天高任鸟飞,海阔凭鱼跃

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  23 随笔 :: 0 文章 :: 39 评论 :: 0 引用
StrSql = "Insert into AAA(Name) Values('hello');Select @ID=@@IDENTITY"
m_Command = new SqlCommand( StrSql, m_Connection );
int newid = Convert.ToInt32( m_Command.ExecuteScalar() );

in storeprecedure:
Insert into AAA(Name) Values('hello')
Select @ID=@@IDENTITY
posted on 2006-01-24 14:32 Kevin 阅读(61) 评论(0) 编辑 收藏