标红的代码出错。。。
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ProductID = Request.QueryString["id"].ToString();//未将对象引用设置到对象的实例。
dt = DateTime.Now.Date;
SqlConnection connection = new SqlConnection(ConfigurationManager.AppSettings["ConnStr"]);
string sql = "select * from Products where ProductState=0 and ProductId=" + ProductID; //数据库连接字符串
SqlCommand command = new SqlCommand(sql, connection);//构件执行数据命令
connection.Open();
SqlDataReader dr = command.ExecuteReader();//保存从数据库里面返回的一条记录
这个错误怎么处理啊??是不是缺少存储过程