ASP源码
PHP源码
.NET源码
JSP源码
public SqlDataReader GetReviews(int productID) {
// 创建Connection和Command对象实例
SqlConnection myConnection = new SqlConnection(Co***gurationSettings.AppSettings[ConnectionString]);
SqlCommand myCommand = new SqlCommand(ReviewsList, myConnection);
my***mand.CommandType = Co***ndType.StoredProcedure;
// 参数
SqlParameter parameterProductID = new SqlParameter(@ProductID, Sq***Type.Int, 4);
pa***eterProductID.Value = productID;
my***mand.Parameters.Add(parameterProductID);
// 执行
my***nection.Open();
SqlDataReader result = my***mand.ExecuteReader(Co***ndBehavior.CloseConnection);
// 返回结果
return result;
数据库连接;return true>