<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<%@Import Namespace="System.Data.OleDb"%>
<script language="c#" runat="server" >
void page_load()
{
string strconn = "Provider = Microsoft.Jet.OleDb.4.0; Data Source=chinacoat.mdb";
OleDbConnection sampleconn=new OleDbConnection(strconn);
try{
sampleconn.Open();
OleDbCommand cmd = new OleDbCommand("select * from detail where id1=5", sampleconn);
OleDbDataReader rdr = cmd.ExecuteReader();
Label3.Text = rdr["comapanychi"].ToString();
}finally{
}
/*conn_str.Text="pppppp";*/
}
</script>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label3" runat="server" Width="298px"></asp:Label>
</form>
</body>
</html>
我的标签里怎么没显示数据,大家帮我看看,谢谢!