昨天写了我的第一个.net程序

      ::键盘时代:: 2004-8-19 8:34
感觉自己现在写程序越来越多了,真烦恼啊~~~

<%@ page language="c#" EnableSessionState="True" %>

<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<html>
<head>
<title>test</title>
<script language="c#" runat="server">
DataSet rs =new DataSet();
public void Page_load(Object src,EventArgs e)
{
string sql="select * from test";
string myconnstr="Provider=Microsoft.Jet.OLEDB.4.0; Data Source="+ Server.MapPath("test.mdb");
OleDbConnection myconn=new OleDbConnection(myconnstr);
OleDbDataAdapter myadapter=new OleDbDataAdapter(sql,myconn);
myadapter.Fill(rs,"name");
name.DataSource=rs.Tables["name"].DefaultView;
name.DataBind();
}
</script>
</head>
<body>
<asp:DataGrid id="name" runat="server" Headerstyle-BackColor="#aaaadd" AlternatingItemStyle-BackColor="#eeeeee"/>
</body>
</html>
标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}