C#作的GridView控件中内容为什么显示不出来?(C#做的)
源代码如下<headrunat="server"><title>正安医疗员工业绩管理系统</title><metahttp-equiv="Content-Type"con...
源代码如下
<head runat="server">
<title>正安医疗员工业绩管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../Image/style.css" type=text/css rel=stylesheet>
<script language="JavaScript" src="../Image/js.js"></SCRIPT>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
.STYLE2 {color: #0000FF}
.STYLE3 {color: #00FF00}
-->
</style>
</head>
<body text="#000000">
<form id="form1" runat="server">
<table width="100%" border="0" cellpadding="2" cellspacing="0" align="center" class=TableBorder>
<tr height="22" valign="middle" align="center">
<th colspan="10">员工信息</th>
</tr>
</table>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="AccessDataSource1"
Width="100%" HorizontalAlign="Center">
<Columns>
<asp:BoundField DataField="工号" HeaderText="工号" SortExpression="工号" />
<asp:BoundField DataField="姓名" HeaderText="姓名" SortExpression="姓名" />
<asp:BoundField DataField="部门" HeaderText="部门" SortExpression="部门" />
<asp:BoundField DataField="代理产品数量" HeaderText="代理产品数量" SortExpression="代理产品数量" />
<asp:BoundField DataField="职务" HeaderText="职务" SortExpression="职务" />
<asp:BoundField DataField="加入时间" HeaderText="加入时间" SortExpression="加入时间" />
<asp:TemplateField HeaderText="详细信息" ShowHeader="False">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="FEmployee_Details.aspx">详细信息</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle HorizontalAlign="Center"/>
</asp:GridView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/zadb.mdb"
SelectCommand="SELECT EmployeeInfo.EID AS 工号, EmployeeInfo.EName AS 姓名, DepartmentInfo.DepartmentName AS 部门, EmployeeInfo.DLLevel AS 代理级别, EmployeeInfo.PCount AS 代理产品数量, DutyInfo.DutyName AS 职务, EmployeeInfo.AddDate AS 加入时间 FROM ((DepartmentInfo INNER JOIN EmployeeInfo ON DepartmentInfo.EID = EmployeeInfo.EID) INNER JOIN DutyInfo ON EmployeeInfo.DutyID = DutyInfo.DutyID)">
</asp:AccessDataSource>
</form>
</body>
</html>
生成之后,只是显示"员工信息"这个标题,GridView绑定数据库的内容显示不出来. 展开
<head runat="server">
<title>正安医疗员工业绩管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../Image/style.css" type=text/css rel=stylesheet>
<script language="JavaScript" src="../Image/js.js"></SCRIPT>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
.STYLE2 {color: #0000FF}
.STYLE3 {color: #00FF00}
-->
</style>
</head>
<body text="#000000">
<form id="form1" runat="server">
<table width="100%" border="0" cellpadding="2" cellspacing="0" align="center" class=TableBorder>
<tr height="22" valign="middle" align="center">
<th colspan="10">员工信息</th>
</tr>
</table>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="AccessDataSource1"
Width="100%" HorizontalAlign="Center">
<Columns>
<asp:BoundField DataField="工号" HeaderText="工号" SortExpression="工号" />
<asp:BoundField DataField="姓名" HeaderText="姓名" SortExpression="姓名" />
<asp:BoundField DataField="部门" HeaderText="部门" SortExpression="部门" />
<asp:BoundField DataField="代理产品数量" HeaderText="代理产品数量" SortExpression="代理产品数量" />
<asp:BoundField DataField="职务" HeaderText="职务" SortExpression="职务" />
<asp:BoundField DataField="加入时间" HeaderText="加入时间" SortExpression="加入时间" />
<asp:TemplateField HeaderText="详细信息" ShowHeader="False">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="FEmployee_Details.aspx">详细信息</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle HorizontalAlign="Center"/>
</asp:GridView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/zadb.mdb"
SelectCommand="SELECT EmployeeInfo.EID AS 工号, EmployeeInfo.EName AS 姓名, DepartmentInfo.DepartmentName AS 部门, EmployeeInfo.DLLevel AS 代理级别, EmployeeInfo.PCount AS 代理产品数量, DutyInfo.DutyName AS 职务, EmployeeInfo.AddDate AS 加入时间 FROM ((DepartmentInfo INNER JOIN EmployeeInfo ON DepartmentInfo.EID = EmployeeInfo.EID) INNER JOIN DutyInfo ON EmployeeInfo.DutyID = DutyInfo.DutyID)">
</asp:AccessDataSource>
</form>
</body>
</html>
生成之后,只是显示"员工信息"这个标题,GridView绑定数据库的内容显示不出来. 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询