存储过程是这么写的
。Net中是这么写的
请帮忙看看是哪里的问题?
CREATE PROCEDURE UpLoadFromBank
@b_num varchar(20),
@money decimal,
@ssfd varchar(20),
@time datetime
AS
update db_student set s_ssf=@money,s_ssfd=@ssfd,s_dayinup='1',s_qf='0' where
s_num=@b_num
update db_ruzhu set ruzhu_ynjf='已交',ruzhu_nfjf='否',ruzhu_jftime=@time where
ruzhu_num=@b_num
insert into db_cruzhu
(cruzhu_num,cruzhu_area,cruzhu_nj,cruzhu_zsf,cruzhu_time,cruzhu_lou,cruzhu_leibie)
select ruzhu_num,ruzhu_area,ruzhu_nianji,ruzhu_zsf,convert(varchar(10),getdate
(),120),ruzhu_gongyu,ruzhu_leibie from db_ruzhu where ruzhu_num=@b_num
GO
@b_num varchar(20),
@money decimal,
@ssfd varchar(20),
@time datetime
AS
update db_student set s_ssf=@money,s_ssfd=@ssfd,s_dayinup='1',s_qf='0' where
s_num=@b_num
update db_ruzhu set ruzhu_ynjf='已交',ruzhu_nfjf='否',ruzhu_jftime=@time where
ruzhu_num=@b_num
insert into db_cruzhu
(cruzhu_num,cruzhu_area,cruzhu_nj,cruzhu_zsf,cruzhu_time,cruzhu_lou,cruzhu_leibie)
select ruzhu_num,ruzhu_area,ruzhu_nianji,ruzhu_zsf,convert(varchar(10),getdate
(),120),ruzhu_gongyu,ruzhu_leibie from db_ruzhu where ruzhu_num=@b_num
GO
。Net中是这么写的
DataTable tablefuckT=(DataTable)Session["tableFuckT"];
SqlConnection conn = operate_sql.createCon();
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
int a=0;
foreach(DataRow dr in tablefuckT.Rows)
{
a = a+1;
string b_num=dr["b_number"].ToString();
decimal money = Convert.ToDecimal(dr["b_money"]);
Center.Help.Help.Money Mssf = new HbuHouse.Center.Help.Help.Money(money);
string ssfd = Mssf.ToString();
if(b_num!="")
{
cmd.CommandText = "UpLoadFromBank";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@b_num",SqlDbType.VarChar,20);
cmd.Parameters["@b_num"].Value = "1";
cmd.Parameters.Add("@money",SqlDbType.Decimal);
cmd.Parameters["@money"].Value = money;
cmd.Parameters.Add("@ssfd",SqlDbType.VarChar,20);
cmd.Parameters["@ssfd"].Value = ssfd;
cmd.Parameters.Add("@time",SqlDbType.DateTime);
cmd.Parameters["@time"].Value = operate_admin.GetSystemDate().ToString();
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
}
}
conn.Close();
conn.Dispose();
SqlConnection conn = operate_sql.createCon();
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
int a=0;
foreach(DataRow dr in tablefuckT.Rows)
{
a = a+1;
string b_num=dr["b_number"].ToString();
decimal money = Convert.ToDecimal(dr["b_money"]);
Center.Help.Help.Money Mssf = new HbuHouse.Center.Help.Help.Money(money);
string ssfd = Mssf.ToString();
if(b_num!="")
{
cmd.CommandText = "UpLoadFromBank";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@b_num",SqlDbType.VarChar,20);
cmd.Parameters["@b_num"].Value = "1";
cmd.Parameters.Add("@money",SqlDbType.Decimal);
cmd.Parameters["@money"].Value = money;
cmd.Parameters.Add("@ssfd",SqlDbType.VarChar,20);
cmd.Parameters["@ssfd"].Value = ssfd;
cmd.Parameters.Add("@time",SqlDbType.DateTime);
cmd.Parameters["@time"].Value = operate_admin.GetSystemDate().ToString();
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
}
}
conn.Close();
conn.Dispose();
请帮忙看看是哪里的问题?