2005調用存儲過程
調用無參數的存儲過程可以這樣寫。
SqlDataSource ds = new SqlDataSource();
ds.ConnectionString = "Data Source=(local);Initial Catalog=E_Quotation;User ID=sa;Password=breakin";
ds.SelectCommand = "quote_fit_home";
ds.SelectCommandType = SqlDataSourceCommandType.StoredProcedure ;
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
如果要引入參數的話該怎麼寫?
SqlDataSource ds = new SqlDataSource();
ds.ConnectionString = "Data Source=(local);Initial Catalog=E_Quotation;User ID=sa;Password=breakin";
ds.SelectCommand = "quote_fit_home";
ds.SelectCommandType = SqlDataSourceCommandType.StoredProcedure ;
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
如果要引入參數的話該怎麼寫?