Server Error in '/' Application.
--------------------------------------------------------------------------------Object reference not set to an instance of an object. 
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.NullReferenceException: Object reference not set to an instance of an object.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  Stack Trace: 
[NullReferenceException: Object reference not set to an instance of an object.]
   System.Web.UI.WebControls.PagedDataSource.GetEnumerator() +166
   System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +343
   System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +53
   System.Web.UI.WebControls.Repeater.DataBind() +72
   Default2.Databind() +300
   Default2.Page_Load(Object sender, EventArgs e) +71
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436 

解决方案 »

  1.   

    IIS上应用程序池没有配好……找服务器商……如果是你自己的服务器,那么你自己上IIS配置下……
      

  2.   

    Object reference not set to an instance of an object.未将对象引用到实例
    检查下数据库连接方式,数据库权限,IIS权限,设置,还有程序里的连接字符串~
      

  3.   

    现在还是这个错误~
    哪位大侠给小弟详细讲述一下网站发布在IIs上,以及发布到互联网上的步骤,asp.net2.0程序和sqlserver2005怎么弄~
    谢谢,可以加分~跪求!
      

  4.   

    <?xml version="1.0"?>
    <!-- 
        注意: 除了手动编辑此文件以外,您还可以使用 
        Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
         “网站”->“Asp.Net 配置”选项。
        设置和注释的完整列表在 
        machine.config.comments 中,该文件通常位于 
        \Windows\Microsoft.Net\Framework\v2.x\Config 中
    -->
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <appSettings/>
    <connectionStrings>
    <!--<add name="STInfo" connectionString="server=192.168.1.101;uid=;pwd=;database=STInfo"/>-->
    <!--<add name="STInfo" connectionString="Server=192.168.1.101\SQLEXPRESS;Initial Catalog=STInfo;User ID=admin;Password=admin123456"/>-->
    <add name="STInfo" connectionString="Persist Security Info=True;User ID=admin;Password=admin123456; Initial Catalog=STInfo ;  Data Source=192.168.1.101;  Connect Timeout=30"/>
    </connectionStrings>
    <system.web>
    <!--
                通过 <authentication> 节可以配置 ASP.NET 使用的 
                安全身份验证模式,
                以标识传入的用户。 
            -->
    <authentication mode="Forms">
    <forms name="Login" loginUrl="~/Admin/Login.aspx" timeout="60" />
    </authentication>
    <!-- 
                设置 compilation debug="true" 将调试符号插入
                已编译的页面中。但由于这会 
                影响性能,因此只在开发过程中将此值 
                设置为 true。
            -->
    <compilation debug="true">
    <assemblies>
    <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    </assemblies>
    </compilation> <httpRuntime
     enable="true"
     executionTimeout="90"
     maxRequestLength="4096" />
    <!--
                如果在执行请求的过程中出现未处理的错误,
                则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
                开发人员通过该节可以配置
                要显示的 html 错误页
                以代替错误堆栈跟踪。        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                <error statusCode="403" redirect="NoAccess.htm" />
                <error statusCode="404" redirect="FileNotFound.htm" />
            </customErrors>
            -->
    <customErrors defaultRedirect="~/ErrorPage.htm" mode="RemoteOnly">
    <error statusCode="404" redirect="FileNotFound.htm"/>
    </customErrors>
    </system.web>
    </configuration>---------------------------------------------------------------
    上面是我的web.config
      

  5.   

    试试这个链接字符串~
    如果SQL Server为混合验证模式的话建议不写密码和账号~
    <add name="STInfo" connectionString="Data Source=.\sqlexpress; Persist Security Info=True;Initial Catalog=STInfo ;User ID=admin;Password=admin123456; Connect Timeout=30"/>
      

  6.   

    这是本地连接的哈~
    我估计应该可以~我的网站发布了!就是访问不到数据~本地运行一切OK!
    ---------------------------------------------------------
    兄弟,我在vs中和在发布在本地的网站上试了都可以运行,能访问数据的!
    就是用你的字符串的~
    但是网上发不好的应该也是不行的~
    我仅仅给老板了一个发布的网站,数据库怎么办?
      

  7.   

    郁闷,数据库的mdf文件也要发过去让他装到他的服务器上的SQL SERVER里啊~
      

  8.   

    我给你个资料吧~
    http://blog.csdn.net/wlc_win/archive/2008/12/24/3593519.aspx
      

  9.   

    IIS上应用程序池没有配好……找服务器商…… 如果是你自己的服务器,那么你自己上IIS配置下……
      

  10.   

    兄弟,那你的意思就是把数据库也放到数据库服务器上~我的程序通过数据库服务器IP访问数据~
    你说的真对~我们老板真的什么都不懂的~我给他说说~
    会给分的~
    asp.net(c#)技术群招募成员 有意者请速加群:50961072
      

  11.   

    谢谢~
    兄弟,你那儿有asp.net程序从运行到本地发布以及互联网发布的过程或者步骤吗?
    我新手~不懂的发布网站的~我这个网站都是用vs2005发布网站,然后把发不好的网站拷贝到Internet信息服务下的也不懂
    然后在网站下建立一个虚拟目录,程序就在本地运行了~
    跪求,请多多指教,多学习学习!