NinetyNine's Treasure

| 积淀*育创新 智慧创造价值|

导航

请教:为什么存储过程不执行?

Posted on 2007-12-23 20:44  (NineTyNine)  阅读(1233)  评论(0编辑  收藏  举报
存储过程是这么写的
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

。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();

请帮忙看看是哪里的问题?