我用VS2008写了个小程序,打包后,在别人机子能安装,但是不能运行,为什么?
System.Data.OracleClient.OracleException: ORA-12154: TNS:無法解析指定的連線 ID    於 System.Data.OracleClient.OracleException.Check(OciErrorHandle errorHandle, Int32 rc)   於 System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName)   於 System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions)   於 System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)   於 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)   於 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)   於 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)   於 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)   於 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)   於 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)   於 System.Data.OracleClient.OracleConnection.Open()   於 System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)   於 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)   於 System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)   於 System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)   於 UAC_ISQUIT.DataSet3TableAdapters.C_USERXROLETableAdapter.Fill(C_USERXROLEDataTable dataTable)   於 UAC_ISQUIT.frmqunquery.frmqunquery_Load(Object sender, EventArgs e)   於 System.Windows.Forms.Form.OnLoad(EventArgs e)   於 System.Windows.Forms.Form.OnCreateControl()   於 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)   於 System.Windows.Forms.Control.CreateControl()   於 System.Windows.Forms.Control.WmShowWindow(Message& m)   於 System.Windows.Forms.Control.WndProc(Message& m)   於 System.Windows.Forms.ScrollableControl.WndProc(Message& m)   於 System.Windows.Forms.ContainerControl.WndProc(Message& m)   於 System.Windows.Forms.Form.WmShowWindow(Message& m)   於 System.Windows.Forms.Form.WndProc(Message& m)   於 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)   於 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)   於 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)  ************** 已載入的組件 **************mscorlib    組件版本: 2.0.0.0    Win32 版本: 2.0.50727.3603 (GDR.050727-3600)    程式碼基底: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll----------------------------------------UAC_ISQUIT    組件版本: 1.0.0.0    Win32 版本: 1.0.0.0    程式碼基底: file:///C:/Program%20Files/Setup/UAC_ISQUIT.exe----------------------------------------System.Windows.Forms    組件版本: 2.0.0.0    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)    程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll----------------------------------------System    組件版本: 2.0.0.0    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)    程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll----------------------------------------System.Drawing    組件版本: 2.0.0.0    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)    程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll----------------------------------------System.Configuration    組件版本: 2.0.0.0    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)    程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll----------------------------------------System.Xml    組件版本: 2.0.0.0    Win32 版本: 2.0.50727.3082 (QFE.050727-3000)    程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll----------------------------------------System.Data    組件版本: 2.0.0.0    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)    程式碼基底: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll----------------------------------------System.Windows.Forms.resources    組件版本: 2.0.0.0    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)    程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHT_b77a5c561934e089/System.Windows.Forms.resources.dll----------------------------------------System.Data.DataSetExtensions    組件版本: 3.5.0.0    Win32 版本: 3.5.30729.1 built by: SP    程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Data.DataSetExtensions/3.5.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll----------------------------------------System.Core    組件版本: 3.5.0.0    Win32 版本: 3.5.30729.1 built by: SP    程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll----------------------------------------mscorlib.resources    組件版本: 2.0.0.0    Win32 版本: 2.0.50727.3603 (GDR.050727-3600)    程式碼基底: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll----------------------------------------System.Data.OracleClient    組件版本: 2.0.0.0    Win32 版本: 2.0.50727.3082 (QFE.050727-3000)    程式碼基底: file:///C:/WINDOWS/assembly/GAC_32/System.Data.OracleClient/2.0.0.0__b77a5c561934e089/System.Data.OracleClient.dll----------------------------------------System.Data.OracleClient.resources    組件版本: 2.0.0.0    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)    程式碼基底: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Data.OracleClient.resources/2.0.0.0_zh-CHT_b77a5c561934e089/System.Data.OracleClient.resources.dll----------------------------------------System.Transactions    組件版本: 2.0.0.0    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)    程式碼基底: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll----------------------------------------System.EnterpriseServices    組件版本: 2.0.0.0    Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000)    程式碼基底: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll---------------------------------------- ************** JIT 偵錯 **************若要啟用 Just-In-Time (JIT) 偵錯功能,則必須在此應用程式或電腦的 .config 檔案中,設定system.windows.forms 區段內的 jitDebugging 值。且該應用程式也必須在啟用偵錯的狀態下進行編譯。 例如: <configuration>    <system.windows.forms jitDebugging="true" /></configuration> 當 JIT 偵錯功能啟用後,會將所有未處理的例外狀況傳送給電腦上已註冊的 JIT 偵錯工具進行處理,而不是使用這個對話方塊來處理。

解决方案 »

  1.   

    路过接分! 貌似另一个电脑上没有安装 .NET FRAMEWORK
      

  2.   

    他的电脑上装了.NET FRAMEWORK。
    因为1、他也装了VS2008;
        2、我把.NET FRAMEWORK打包进去了。
      

  3.   

    我的数据库是Oracle
    数据库名:UACSYS
    username:admin
    PWD:admin123456
      string Oracleconstring = "Data Source=UACSYS;Persist Security Info=True;User ID=adminword=admin123456;Unicode=True;";
      

  4.   

    你安装了Oracle的客户端程序了吗?
      

  5.   

    我安装了ORACLE客户端,用P/LSQL打开数据库的。
      

  6.   

    你的当前运行.NET程序的这台有没有安装ORACLE客户端. (不是ORACLE数据库.) 大约有10M左右.Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0] 
    "ORACLE_HOME_NAME"="ORA" 
    "ORACLE_HOME"="D:\\Ora10InstantClient"
    "NLS_LANG"="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"在看看注册表是否正确.路径和名字换成你的. 
      

  7.   

    查看tnsnames.ora 
    http://topic.csdn.net/u/20090822/13/416f34d2-ca0b-4fd1-ae0d-127c4e20dd18.html
      

  8.   

    运行程序的这台机器要安装oracle客户端的。
      

  9.   

    同时还要配置tnsnames.ora