改了一样有错
源码:
<%@Page language=VB Debug=true%>
<%@import namespace="system.data"%>
<%@import namespace="system.data.oledb"%>
<script runat=server language="VB">
sub page_load(byval sender as object,byval e as eventargs)
if not ispostback then
dim conn as new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source="+server.mappath("ex.mdb"))
dim objda as new OleDbdataAdapter("select courseid,coursename from courses",conn)
dim objds as new DataSet
objda.Fill(objds,"courses")
'ddlcourses.datasource=objdata.tables("courses").defaultview
'ddlcourses.databind()
end if
end sub
</script>
错误提示:
至少一个参数没有被指定值。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Data.OleDb.OleDbException: 至少一个参数没有被指定值。源错误:
行 8: dim objda as new OleDbdataAdapter("select courseid, coursename from courses",conn)
行 9: dim objds as new DataSet
行 10: objda.Fill(objds,"courses")
行 11: 'ddlcourses.datasource=objdata.tables("courses").defaultview
行 12: 'ddlcourses.databind()
源文件: c:\inetpub\wwwroot\ex\2.aspx 行: 10 堆栈跟踪:
[OleDbException (0x80040e10): 至少一个参数没有被指定值。]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) +41
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +174
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +92
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +65
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +112
System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +69
System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +5
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
ASP._2_aspx.page_load(Object sender, EventArgs e) in c:\inetpub\wwwroot\ex\2.aspx:10
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.573; ASP.NET 版本:1.1.4322.573
源码:
<%@Page language=VB Debug=true%>
<%@import namespace="system.data"%>
<%@import namespace="system.data.oledb"%>
<script runat=server language="VB">
sub page_load(byval sender as object,byval e as eventargs)
if not ispostback then
dim conn as new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source="+server.mappath("ex.mdb"))
dim objda as new OleDbdataAdapter("select courseid,coursename from courses",conn)
dim objds as new DataSet
objda.Fill(objds,"courses")
'ddlcourses.datasource=objdata.tables("courses").defaultview
'ddlcourses.databind()
end if
end sub
</script>
错误提示:
至少一个参数没有被指定值。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Data.OleDb.OleDbException: 至少一个参数没有被指定值。源错误:
行 8: dim objda as new OleDbdataAdapter("select courseid, coursename from courses",conn)
行 9: dim objds as new DataSet
行 10: objda.Fill(objds,"courses")
行 11: 'ddlcourses.datasource=objdata.tables("courses").defaultview
行 12: 'ddlcourses.databind()
源文件: c:\inetpub\wwwroot\ex\2.aspx 行: 10 堆栈跟踪:
[OleDbException (0x80040e10): 至少一个参数没有被指定值。]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) +41
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +174
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +92
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +65
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +112
System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +69
System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +5
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
ASP._2_aspx.page_load(Object sender, EventArgs e) in c:\inetpub\wwwroot\ex\2.aspx:10
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.573; ASP.NET 版本:1.1.4322.573
private dataset...
adapter=new oledbdataadpter("select",mycon);
dataset=new DataSet();
adapter.fill(dataset,"test");