2011-05-09 66 views
0

我有一個查詢託管在Windows 2003服務器上的數據庫的應用程序。 IIS似乎正常工作,因爲其他應用程序工作正常。ASP.NET APP僅在服務器執行查詢時纔有效

但是,當我嘗試從遠程機器訪問此應用程序時,出現錯誤。

我意識到,當我從服務器執行查詢時,應用程序開始在遠程PC上工作。然後該應用程序遠程工作。

這是怎麼發生的?這是證書問題嗎?有人有線索嗎?

這裏是例外

 
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.] 
    BH.Sysnet.DBHelper.SetSqlExceptionMessage(StringBuilder msg, Exception ex) +741 
    BH.Sysnet.DBHelper.CreateDbException(DB db, Exception ex) +68 
    BH.Sysnet.DB.ExecuteReturnDS(String sql, CommandType statementType, String nombreDataTable, DataSet ds) +206 
    BH.Sysnet.DB.ExecuteReturnDS(String sql, String nombreDataTable, DataSet ds) +15 
    BH.Sysnet.DB.ExecuteReturnDS(String sql, String nombreDataTable) +12 
    BH.Sysnet.DB.ExecuteReturnDS(String sql) +16 
    BH.GIDEWS.Pages.Log.Buscar() +1717 
    BH.GIDEWS.Pages.Log.btnBuscar_Click(Object sender, EventArgs e) +35 
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111 
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110 
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565 

+4

你得到的錯誤信息是什麼? – fretje 2011-05-09 14:02:17

+0

當您在本地訪問應用程序時,是否在開發環境中這樣做?在數據庫服務器上運行什麼樣的身份驗證(什麼類型的數據庫服務器?) – 2011-05-09 14:07:20

+0

未將對象引用設置爲對象的實例。這看起來像服務器無法從數據庫中獲取值 – ShinyDarkStone 2011-05-09 14:08:37

回答

0

檢查,你可以看到服務器上的相應端口從遠程計算機 - 這會是一個防火牆配置問題?

接下來,確認您能夠從遠程機器連接到數據庫。使用任何SQL命令提示工具是可用的,看看會發生什麼......這裏的想法是排除權限問題 - 你是否允許從遠程機器連接?

如果你能夠用你所得到的輸出的話,你可以張貼錯誤的代碼,一起(全異常文本(如果可用)...)

馬丁。

+0

第一個問題,是的,我可以看到合適的端口,不,它不能成爲防火牆,因爲它是一個開發服務器,它具有所有的安全選項,所以我們可以測試一切。 我可以連接到我使用的數據庫。我可以連接,讓我看看我能否得到它失敗的地方。 我會立即更新完整的例外 – ShinyDarkStone 2011-05-09 14:21:34

相關問題