Server Error in '/' Application.

Server Error in '/' Application.
--------------------------------------------------------------------------------

Index was outside the bounds of the array.
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.IndexOutOfRangeException: Index was outside the bounds of the array.

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:

[IndexOutOfRangeException: Index was outside the bounds of the array.]
inquiry.SubBtn_Click(Object sender, EventArgs e) +1069
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

人工同步IWAM账号在Active Directory、IIS metabase数据库和COM+应用程序中的密码。

具体操作分三步,均需要以管理员身份登录计算机以提供足够的操作权限(IWAM账号以IWAM_MYSERVER为例)。

(一)更改Active Directory中IWAM_MYSERVER账号的密码

因IWAM账号的密码由系统控制,随机产生,我们并不知道是什么,为完成下面两步的密码同步工作,我们必须将IWAM账号的密码设置为一个我们知道的值。

1、选择“开始”->“程序”->“管理工具”->"Active Directory用户和计算机",启动“Active Directory用户和计算机”管理单元。

2、单击“user”,选中右面的“IWAM_MYSERVER”,右击选择“重设密码(T)...”,在跳出的重设密码对方框中给IWAM_MYSERVER设置新的密码,这儿我们设置成“Aboutnt2001”(没有引号的),确定,等待密码修改成功。

(二)同步IIS metabase中IWAM_MYSERVER账号的密码

可能因为这项改动太敏感和重要,微软并没有为我们修改IIS metabase中IWAM_MYSERVER账号密码提供一个显式的用户接口,只随IIS5提供了一个管理脚本adsutil.vbs,这个脚本位于 C:\inetpub\adminscripts子目录下(位置可能会因你安装IIS5时设置的不同而有所变动)。

adsutil.vbs脚本功能强大,参数非常多且用法复杂,这里只提供使用这个脚本修改IWAM_MYSERVER账号密码的方法:

adsutil SET w3svc/WAMUserPass Password

"Password"参数就是要设置的IWAM账号的新的密码。因此我们将IIS metabase中IWAM_MYSERVER账号的密码修改为“Aboutnt2001”的命令就是:

c:\Inetpub\AdminScripts>adsutil SET w3svc/WAMUserPass "Aboutnt2001"

修改成功后,系统会有如下提示:

WAMUserPass: (String) "Aboutnt2001"

(三)同步COM+应用程序所用的IWAM_MYSERVER的密码

同步COM+应用程序所用的IWAM_MYSERVER的密码,我们有两种方式可以选择:一种是使用组件服务MMC管理单元,另一种是使用IWAM账号同步脚本synciwam.vbs。

1、使用组件服务MMC管理单元

(1)启动组件服务管理单元:选择“开始”->“运行”->“MMC”,启动管理控制台,打开“添加/删除管理单元”对话框,将“组件服务”管理单元添加上。

(2)找到“组件服务”->“计算机”->“我的电脑”->“COM+应用程序”->“Out-Of-Process Pooled Applications”,右击“Out-Of-Process Pooled Applications”->“属性”。

(3)切换到“Out-Of-Process Pooled Applications”属性对话框的“标志”选项卡。“此应用程序在下列账户下运行”选择中“此用户”会被选中,用户名是 “IWAM_MYSERVER”。这些都是缺省的,不必改动。在下面的“密码”和“确认密码”文本框内输入正确的密码“Aboutnt2001”,确定退出。

(4)系统如果提示“应用程序被一个以上的外部产品创建。你确定要被这些产品支持吗?”时确定即可。

(5)如果我们在IIS中将其它一些Web的“应用程序保护”设置为“高(独立的)”,那么这个WEB所使用的COM+应用程序的IWAM账号密码也需要同步。重复(1)-(4)步,同步其它相应Out of process application的IWAM账号密码。

2、使用IWAM账号同步脚本synciwam.vbs

实际上微软已经发现IWAM账号在密码同步方面存在问题,因此在IIS5的管理脚本中单独为IWAM账号密码同步编写了一个脚本 synciwam.vbs,这个脚本位于C:\inetpub\adminscripts子目录下(位置可能会因你安装IIS5时设置的不同而有所变动)。

synciwam.vbs脚本用法比较简单:

cscript synciwam.vbs [-v|-h]

“-v”参数表示详细显示脚本执行的整个过程(建议使用),“-h”参数用于显示简单的帮助信息。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2009-07-18
Index was outside the bounds of the array
是索引超出数列范围的意思

就是说
好比你取得结果集是RS rs只有4条记录 而你的判断取了5条
这个时候就会报错本回答被提问者采纳
相似回答