从数据库读取出数据并转换成int类型进行判断
cn.Open();
string sql = "select Placed from enterprise ";//这里没个where条件么?比如where id=1之类的
SqlCommand cmd = new SqlCommand(sql, cn);
object obj = cmd.ExecuteScalar();
int x = Convert.ToInt32(obj);
if (x == 0)
{
Response.Write("<script>window.open('2.aspx');</script>");
}
else
{
Response.Write("<script>window.open('1.aspx');</script>");
}
cn.Close();
怎么都是跳到2.aspx上了啊,不能跳到1.aspx,有人能帮忙看看么