我机子上装有ACCESS2000和SQL SERVER 2000 磁盘格式是FAT32格式的在ASP.NET中连接SQL数据库,总是出现登陆失败的提示,adapter.Fill(ds, "userinfo");这一句红色显示
连接语句我是检查了几遍也发给网友看过,都说没有错然后我再连接ACCESS数据库,这次是提示连接语句红色显示,而这条语句本也没有
语法错误那位大哥碰到过这种情况,这里是语句,还是数据库软件的原因可是,我用ASP程序连接数据库又可以
连接语句我是检查了几遍也发给网友看过,都说没有错然后我再连接ACCESS数据库,这次是提示连接语句红色显示,而这条语句本也没有
语法错误那位大哥碰到过这种情况,这里是语句,还是数据库软件的原因可是,我用ASP程序连接数据库又可以
解决方案 »
- 重装系统后asp.net应用无法连接到SQL server2000数据库
- Rating控件数据绑定问题
- 新手请教一个问题,如何将页面中的表格并排放在一起
- 关于Atlas的基本框架问题
- 什么是IIS连接数?
- asp.net中.关于客户端javascript调用服务器端程序的问题.
- vs2010可以让程序回到上次成功运行的状态吗
- ~~~~~~~~~~~~~~~~~~~两个问题~~~~~~~~~~~~~~~~~~
- 请教.net服务器问题
- 请教各位诸如findcontrol等函数是从sdk学的,还是从别的书学的,推荐本好书吧,一定给分
- 非常急给分!我想把WEB用户控件与组件类放在一个项目中生成DLL!!!
- 在DataList中如何显示((Price2)-(Price1))的结果?
http://blog.csdn.net/ChengKing/archive/2005/10/14/504078.aspx
<%@ Import Namespace="System.Data" %>
<%//@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Data.OleDb"%><html>
<script language="c#" runat="server">
protected void Page_Load(object sender,EventArgs e)
{
String strcon= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("database/db1.mdb");
OleDbConnection myConnection =new OleDbConnection(strcon);
myConnection.Open();
DataSet ds = new DataSet();
OleDbDataAdapter adapter = new OleDbDataAdapter("Select * from userinfo", myConnection);
adapter.Fill(ds, "userinfo");
mydg.DataSource = ds.Tables["userinfo"].DefaultView;
mydg.DataBind();
myConnection.Close();} </script>
<body>
<h3 align="center">List</h3>
<asp:DataGrid ID="mydg" runat="server"
AutoGenerateColumns="false"
BackColor="#ccccff"
BorderColor="#0B0000"
ShowFooter="false"
CellPadding="3"
CellSpacing="0"
Font-Name="verdana"
Font-Size="8"
HeaderStyle-BackColor="#aaaadd"
EnableViewState="false">
<columns>
<asp:BoundColumn FooterText="Ðò¡¡ºÅ" DataField="id" />
<asp:BoundColumn FooterText="Ãû¡¡³Æ" DataField="username"/>
<asp:BoundColumn FooterText="Ãè¡¡Êö" DataField="addren"/>
</columns>
</asp:DataGrid>
</body>
</html>
Server Error in '/temp' Application.
--------------------------------------------------------------------------------A field or property with the name 'addren' was not found on the selected datasource.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: A field or property with the name 'addren' was not found on the selected datasource.Source Error:
Line 37: adapter.Fill(ds, "userinfo");
Line 38: mydg.DataSource = ds.Tables["userinfo"].DefaultView;
Line 39: mydg.DataBind();
Line 40: myConnection.Close();
Line 41:
Source File: E:\li\asp.net\data1.aspx Line: 39
又有,检查一下
没有addren字段!