谁懂得在C#里,SQL里的存储过程具体怎么用吗?指教!

解决方案 »

  1.   

    SqlCommand cmd=new SqlCommand("RegionSelect",Conn);
    cmd.CommandType=CommandType.StoredProcedure;
    cmd.UpdatedRowSource=UpdateRowSource.None;

    //连接数据库,和设置数据适配器
    SqlDataAdapter sda=new SqlDataAdapter();
    sda.SelectCommand=cmd;
      

  2.   

    怎么把窗体的TextBox1赋给存储过程中的参数@ID呢?指教!
      

  3.   

    有什么PARAMETER.ADD的方法,找找吧
      

  4.   

    使用 SqlParameter SqlParameter sqlPara = new SqlParameter("@para", SqlDbType.NVarChar, 60 );
    sqlPara.Value = this.TextBox1.Text.Trim();
    sqlPara.Direction = ParameterDirection.Input;