错误啊!~~~

2 views
Skip to first unread message

zen...@gmail.com

unread,
Jun 27, 2006, 10:23:03 PM6/27/06
to ASP.NET FOOD
“/工作周报提交系统”应用程序中的服务器错误。
--------------------------------------------------------------------------------

未将对象引用设置到对象的实例。
说明: 执行当前 Web
请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。


异常详细信息: System.NullReferenceException:
未将对象引用设置到对象的实例。

源错误:


行 34: List<Employees> Employees = new List<Employees>();
行 35: //连接字符串语句
行 36: SqlConnection conn = new
SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
行 37: //填写SQL语句
行 38: //string commandText="select * from *",string
commandText="select * from Person"


源文件:
e:\工作周报提交系统\工作周报提交系统\App_Code\employeesDB.cs
行: 36

堆栈跟踪:


[NullReferenceException: 未将对象引用设置到对象的实例。]
EmployeesDB.LoadAllEmployees() in
e:\工作周报提交系统\工作周报提交系统\App_Code\employeesDB.cs:36

[TargetInvocationException: 调用的目标发生了异常。]
System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[]
arguments, SignatureStruct& sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner) +0
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[]
arguments, Signature sig, MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner) +72
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture,
Boolean skipVisibilityChecks) +296
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
+29

System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod
method, Boolean disposeInstance, Object& instance) +484

System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments
arguments) +1869
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments
arguments, DataSourceViewSelectCallback callback) +13
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +140
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +68
System.Web.UI.WebControls.GridView.DataBind() +5
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +61

System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
+67
System.Web.UI.Control.EnsureChildControls() +97
System.Web.UI.Control.PreRenderRecursiveInternal() +50
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+5729

ttaq...@gmail.com

unread,
Jun 27, 2006, 10:31:57 PM6/27/06
to ASP.NET FOOD
//string commandText="select * from *",
string commandText="select * from Person",
那个string 怎么放在上面的
Reply all
Reply to author
Forward
0 new messages