if (Request.QueryString["ID"] != null)
        {
            string id = Request.QueryString["ID"].ToString();
            string update = "update_Scase";            SqlParameter[] param ={  
                                        new SqlParameter("@Title",SqlDbType.NVarChar),
                                        new SqlParameter("@Content",SqlDbType.NText),
                                        new SqlParameter("@CreatTime",SqlDbType.NVarChar),
                                        new SqlParameter("@Company",SqlDbType.NVarChar),
                                        new SqlParameter("@Area",SqlDbType.NVarChar),
                                        new SqlParameter("@Product",SqlDbType.NVarChar),
                                        new SqlParameter("@Info",SqlDbType.NText)
                                  };
            
            param[0].Value = title;
            param[1].Value = content;
            param[2].Value = time;
            param[3].Value = company;
            param[4].Value = area;
            param[5].Value = product;
            param[6].Value = info;
int count = Convert.ToInt32(sqlHelper.ExecuteNonQuery(sqlHelper.conn, CommandType.StoredProcedure, update, param));使用这个类如何通过存储过程更新一条信息(注:不会获取ID,郁闷)

解决方案 »

  1.   

    把ID也传进来么,在update_Scase存储过程里判断所传ID。
      

  2.   

    把ID也传过去,
    CREATE proc sel_Scase
    (
    @ID int
    )
    as
    select Company,Area,Product,Info,Title,convert(char(10),CreatTime,120) as CreatTime,Content,Image,Type from zqc_Scase
    where ID=@IDGO
    可是不会传..郁闷
      

  3.   

    是这个
    CREATE proc update_Scase
    (
    @ID int,
    @Title nvarchar,
    @Content ntext,
    @CreatTime datetime,
    @Company nvarchar,
    @Area nvarchar,
    @Product nvarchar,
    @Info ntext
    )
    as
    update zqc_Scase set Title=@Title,Content=@Content,CreatTime=@CreatTime,Company=@Company,Area=@Area,Product=@Product,Info=@Info
    where ID=@IDGO
      

  4.   

    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Create date: 2007-6-7
    -- Description: 更改密码
    -- =============================================
    ALTER PROCEDURE [dbo].[proc_ChangePWD_Users]
    @ID int, --用户ID号
    @password nvarchar(150)  --用户密码
    AS
    BEGIN
    UPDATE Sys_Users SET Usr_Password = @password WHERE Usr_ID = @ID
    END给你个简单的参考好了。
      

  5.   

    UPDATE Sys_Users SET Usr_Password = @password WHERE Usr_ID = @ID
    这个Usr_ID=@ID的ID在后台程序怎么写呢?当Request.QueryString["ID"] != null时
      

  6.   

    UPDATE这个肯定是DAL的方法啊,你页面那判断ID为空的时候就不调用这个方法了么,不为空的话就直接调用方法,把参数传过来,这个ID参数直接是:Request.QueryString["ID"]
      

  7.   

    谢谢,还有一个问题
    有没有判断输入框为money类型的正则呢