






















我加 了参数就读不出数据了。
BigType=Convert.ToString(Request.QueryString["Big"]);
SmallType=Convert.ToString(Request.QueryString["Small"]);
string sqlconn = ConfigurationSettings.AppSettings["strconn"];
SqlConnection conn=new SqlConnection(sqlconn);
conn.Open();
SqlDataAdapter adpa=new SqlDataAdapter("b_GetMovieList",conn);
adpa.SelectCommand.CommandType=CommandType.StoredProcedure;
//下面注释掉后就不能显示数据,当然储存过程也要改
adpa.SelectCommand.Parameters.Add( new SqlParameter("@BigType",SqlDbType.VarChar,50));
adpa.SelectCommand.Parameters["@BigType"].Value = BigType;
adpa.SelectCommand.Parameters.Add( new SqlParameter("@SmallType",SqlDbType.VarChar,50));
adpa.SelectCommand.Parameters["@SmallType"].Value = SmallType;



存储过程:
CREATE Proc b_GetMovieList
as
select
*
FROM b_movie
ORDER BY id desc
GO
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。