using(SqlConnection connection = DataConnection.GetConnection())
{
string sql = "SELECT [s_id],[s_xuehao],[s_name],[s_sex],[s_date],[s_prof] FROM [studentInfo]";
SqlDataAdapter da = new SqlDataAdapter(sql,connection);
DataSet ds = new DataSet();
da.Fill(ds, AspNetPager1.PageSize*(AspNetPager1.CurrentPageIndex - 1), AspNetPager1.PageSize, "Table");
Repeater1.DataSource = ds;
Repeater1.DataBind();
connection.Close();
}把上面的代码,改成用存储过程怎么写法呢?如果存储过程有参数又怎么写法呢?
谢谢!
http://topic.csdn.net/u/20091204/21/722689e1-7824-497c-b709-4b1118264633.html?81737
sqlCmd.CommandText = "proc_sel";sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.CommandText = "proc_history";
sqlCmd.CommandType = CommandType.StoredProcedure;
sqlCmd.Parameters.Add(new SqlParameter("@id", id));