为什么把代码放到ASPX中就不执行了?
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<FONT face="宋体"></FONT>
<script runat="server">
void Page_Load(object sender, System.EventArgs e)
{
if(!Page.IsPostBack)
{
OracleConnection conn = new OracleConnection("Data Source=ALLAN;User Id=LY;Password=usoft;Integrated Security=no;" );
string sql="select 申请序号 from 油气勘查档案";
OracleCommand myCommand = new OracleCommand(sql,conn);
conn.Open();
OracleDataReader myReader = myCommand.ExecuteReader();
while(myReader.Read())
{
Response.Write(myReader.GetString(0));
Response.Write("<br>");
}
myReader.Close();
conn.Close();
}
}
</script>
</form>
</body>
如果放在后台CS文件中就可以,为什么?怎么样才能让它在前台页面中显示