读书人

help!这个是什么东东?该如何解决

发布时间: 2012-02-22 19:36:55 作者: rapoo

help!!!!!!!!!!!这个是什么错误?该怎么解决?
这个是什么错误?
“/loupan”应用程序中的服务器错误。
--------------------------------------------

至少一个参数没有被指定值。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.Data.OleDb.OleDbException: 至少一个参数没有被指定值。

源错误:

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。

堆栈跟踪:


[OleDbException (0x80040e10): 至少一个参数没有被指定值。]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) +41
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +174
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleRow(tagDBPARAMS dbParams, Object& executeResult) +206
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +107
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
loupan.chaxun.Page_Load(Object sender, EventArgs e) +1119
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731


代码如下:

StartIndex = 0;//StartIndex是int类型的公用变量


// string name;
//name=Server.MapPath( "lpan.mdb ");
myConnection2 = new OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source= " + dbname );
myConnection2.Open();

myCommand2 = new OleDbCommand( "SELECT mycount = COUNT(*) FROM lpan ", myConnection2 );

//myConnection2.Open();

//OleDbDataReader dr = myCommand2.ExecuteReader(CommandBehavior.SingleRow);
OleDbDataReader dr = myCommand2.ExecuteReader(CommandBehavior.SingleRow);

if (dr.Read())

DataGrid1.VirtualItemCount = (int)dr[ "mycount "];

dr.Close();

myConnection2.Close();

SetGridSource(StartIndex, "上一页 ");

[解决办法]
我试过了,没错的
[解决办法]
myCommand2 = new OleDbCommand( "SELECT COUNT(*) as mycount FROM lpan ", myConnection2 );

读书人网 >asp.net

热点推荐