日期:2014-05-17 浏览次数:20424 次
if object_id('[tb]') is not null drop table [tb]
go
create table [tb]([ID] int identity(1,1),[列] varchar(1),[内容] int)
insert [tb] select 'A',100
select @@IDENTITY as 返回值
/// <summary>
///
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
public int SaveUserProfile(UserProfile user) {
SqlParameter[] p = new SqlParameter[] {
SqlHelper.MakeInParameter(AT + FILED_USER_PROFILE_ID, SqlDbType.Int, 4, user.UserProfileId),
SqlHelper.MakeInParameter(AT + FILED_MEMBER_ID, SqlDbType.NVarChar, 50, user.MemberId),
SqlHelper.MakeInParameter(AT + FILED_EMAIL, SqlDbType.VarChar, 128, user.Email),
SqlHelper.MakeInParameter(AT + FIELD_CREATED_DATE, SqlDbType.DateTime, 8, user.CreatedDate == DateTime.MinValue ? DateTime.Now : user.CreatedDate),
SqlHelper.MakeInParameter(AT + FIELD_CREATED_BY, SqlDbType.NVarChar, 50, user.CreatedBy),
SqlHelper.MakeInParameter(AT + FIELD_MODIFIED_DATE, SqlDbType.DateTime, 8, user.ModifiedDate == DateTime.MinValue ? DateTime.Now : user.ModifiedDate),