呵呵!偶是不是有点市侩
<configuratio gt;
lt;!-- a lication ecific settings -->
lt;a etting gt;
lt;add key="Co ectio tring" value=" erver=localhost;uid=sa wd=;database=store" />
lt;/a etting gt;
<configuratio gt;
public SqlDataReader GetReviews(int productID) {
// 创建Co ection和Command对象实例
qlCo ection myCo ection = new SqlCo ection(Configuratio ettings.A ettings["Co ectio tring"]);
qlCommand myCommand = new SqlCommand("ReviewsList", myCo ection);
myCommand.CommandType = CommandType.StoredProcedure;
// 参数
qlParameter parameterProductID = new SqlParameter("@ProductID", SqlDbType.Int, 4);
arameterProductID.Value = productID;
myCommand.Parameters.Add(parameterProductID);
// 执行
myCo ection.Open();
qlDataReader result = myCommand.ExecuteReader(CommandBehavior.CloseCo ection);
// 返回结果
return result;
}


