如题 12个参数,没多没少,不知道为什么报这个错,麻烦大家帮看看谢谢 initConn();
command.CommandText = "wb_insert_registerInfo";
command.CommandType = CommandType.StoredProcedure; SqlParameter p = null;
p = command.Parameters.Add("@LoginName", SqlDbType.NVarChar, 4000);
p.Value = register.getLoginName();
p = command.Parameters.Add("@Password", SqlDbType.NVarChar, 4000);
p.Value = register.getPassword();
p = command.Parameters.Add("@RealName", SqlDbType.NVarChar, 4000);
p.Value = register.getRealName();
p = command.Parameters.Add("@Sex", SqlDbType.NVarChar, 4000);
p.Value = register.getSex();
p = command.Parameters.Add("@Birthday", SqlDbType.NVarChar, 4000);
p.Value = register.getBirthday();
p = command.Parameters.Add("@Educational", SqlDbType.NVarChar, 4000);
p.Value = register.getEducational();
p = command.Parameters.Add("@WorkUnit", SqlDbType.NVarChar, 4000);
p.Value = register.getWorkUnit();
p = command.Parameters.Add("@PostCode", SqlDbType.NVarChar, 4000);
p.Value = register.getPostCode();
p = command.Parameters.Add("@Address", SqlDbType.NVarChar, 4000);
p.Value = register.getAddress();
p = command.Parameters.Add("@Email", SqlDbType.NVarChar, 4000);
p.Value = register.getEmail();
p = command.Parameters.Add("@Telephone", SqlDbType.NVarChar, 4000);
p.Value = register.getTelephone();
p = command.Parameters.Add("@Cellphone", SqlDbType.NVarChar, 4000);
p.Value = register.getCellphone(); command.ExecuteNonQuery();-------------------------------------存储过程---------------------------------------ALTER proc [dbo].[wb_insert_registerInfo]
(
@LoginName nvarchar(4000),
@Password nvarchar(4000),
@RealName nvarchar(4000),
@Sex nvarchar(4000),
@Birthday nvarchar(4000),
@Educational nvarchar(4000),
@WorkUnit nvarchar(4000),
@PostCode nvarchar(4000),
@Address nvarchar(4000),
@Email nvarchar(4000),
@Telephone nvarchar(4000),
@Cellphone nvarchar(4000)
)
asbegin
insert into WB_userInfo values
(
@LoginName,@Password,@RealName,@Sex,@Birthday,
@Educational,@WorkUnit,@PostCode,@Address,@Email,
@Telephone,@Cellphone
);
end
----------------------------------数据库单独调用存储过程试过没有问题-------------------------------------麻烦了,谢谢
command.CommandText = "wb_insert_registerInfo";
command.CommandType = CommandType.StoredProcedure; SqlParameter p = null;
p = command.Parameters.Add("@LoginName", SqlDbType.NVarChar, 4000);
p.Value = register.getLoginName();
p = command.Parameters.Add("@Password", SqlDbType.NVarChar, 4000);
p.Value = register.getPassword();
p = command.Parameters.Add("@RealName", SqlDbType.NVarChar, 4000);
p.Value = register.getRealName();
p = command.Parameters.Add("@Sex", SqlDbType.NVarChar, 4000);
p.Value = register.getSex();
p = command.Parameters.Add("@Birthday", SqlDbType.NVarChar, 4000);
p.Value = register.getBirthday();
p = command.Parameters.Add("@Educational", SqlDbType.NVarChar, 4000);
p.Value = register.getEducational();
p = command.Parameters.Add("@WorkUnit", SqlDbType.NVarChar, 4000);
p.Value = register.getWorkUnit();
p = command.Parameters.Add("@PostCode", SqlDbType.NVarChar, 4000);
p.Value = register.getPostCode();
p = command.Parameters.Add("@Address", SqlDbType.NVarChar, 4000);
p.Value = register.getAddress();
p = command.Parameters.Add("@Email", SqlDbType.NVarChar, 4000);
p.Value = register.getEmail();
p = command.Parameters.Add("@Telephone", SqlDbType.NVarChar, 4000);
p.Value = register.getTelephone();
p = command.Parameters.Add("@Cellphone", SqlDbType.NVarChar, 4000);
p.Value = register.getCellphone(); command.ExecuteNonQuery();-------------------------------------存储过程---------------------------------------ALTER proc [dbo].[wb_insert_registerInfo]
(
@LoginName nvarchar(4000),
@Password nvarchar(4000),
@RealName nvarchar(4000),
@Sex nvarchar(4000),
@Birthday nvarchar(4000),
@Educational nvarchar(4000),
@WorkUnit nvarchar(4000),
@PostCode nvarchar(4000),
@Address nvarchar(4000),
@Email nvarchar(4000),
@Telephone nvarchar(4000),
@Cellphone nvarchar(4000)
)
asbegin
insert into WB_userInfo values
(
@LoginName,@Password,@RealName,@Sex,@Birthday,
@Educational,@WorkUnit,@PostCode,@Address,@Email,
@Telephone,@Cellphone
);
end
----------------------------------数据库单独调用存储过程试过没有问题-------------------------------------麻烦了,谢谢
能够创建同名字的存储过程吗??