string settings = Convert.ToString(ConfigurationManager.ConnectionStrings["ShoppingConnectionString"]);
SqlConnection myconn = new SqlConnection(settings);
myconn.Open();
SqlCommand mycmd = new SqlCommand("bookcategory2", myconn);
mycmd.CommandType = CommandType.StoredProcedure;
SqlDataReader result = mycmd.ExecuteReader(CommandBehavior.CloseConnection);
ProductView.DataSource = result;
ProductView.DataBind();
转载于:https://www.cnblogs.com/jielig1/archive/2008/04/17/1157243.html