asp.net编程中遇到的问题

using System.Data.SqlClient;

protected void btndata_Click(object sender, EventArgs e)
{
    SqlConnection con = new SqlConnection("DATA SOURCE=WAVE\\SQLEXPRESS;Integrated Security=ture;INITIAL CATALOG=DB_SM;");
    con.Open();
    if (con.State = ConnectionState.Open)
    {
        Response.Write("数据库已打开");
    }
    con.Close();
}

}

用了一个button控件,出现了一个错误:上下文不存在ConnectionState.求解决

ConnectionState在System.Data命名空间中吧?你搜索下。
实际上con.Open没有抛异常的情况下,con的State基本一定是Open的。