无法运行c#program

时间:2016-01-18 01:05:41

标签: c# visual-studio crystal-reports

我的问题是我刚刚使用visual studio 2012,sql server management studio 2014,sap crystal report和.net framework 4.5.1完成了一个C#程序

这不是我第一个按程序完成这些程序的程序

然后我创建了一个安装文件并将其复制到另一台PC并尝试启动它但程序没有启动甚至给我一个错误消息所以我试过我在同一台PC上的旧程序它的工作方式相同

那我该怎么办?

顺便说一下,这台pc我设置.net框架4.5.1,sap crystal report runntime和相同的sql server版本

这是Windows事件日志中的错误

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  - <System>
        <Provider Name=".NET Runtime" /> 
        <EventID Qualifiers="0">1026</EventID> 
        <Level>2</Level> 
        <Task>0</Task> 
        <Keywords>0x80000000000000</Keywords> 
        <TimeCreated SystemTime="2016-01-18T01:22:02.000000000Z" /> 
        <EventRecordID>6715</EventRecordID> 
        <Channel>Application</Channel> 
        <Computer>Tota-pc</Computer> 
        <Security /> 
    </System>
  - <EventData>
        <Data>
            Application: FALCON HR.exe Framework Version: v4.0.30319

          - List item

            Description: The process was terminated due to an unhandled exception. 
            Exception Info: System.Data.SqlClient.SqlException 
            Stack: 
                at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionFactory, System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>, System.Data.Common.DbConnectionOptions) 
                at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionFactory, System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>, System.Data.Common.DbConnectionOptions) 
                at System.Data.SqlClient.SqlConnection.TryOpenInner(System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>) 
                at System.Data.SqlClient.SqlConnection.TryOpen(System.Threading.Tasks.TaskCompletionSource`1<System.Data.ProviderBase.DbConnectionInternal>) 
                at System.Data.SqlClient.SqlConnection.Open() 
                at System.Data.Common.DbDataAdapter.FillInternal(System.Data.DataSet, System.Data.DataTable[], Int32, Int32, System.String, System.Data.IDbCommand, System.Data.CommandBehavior) 
                at System.Data.Common.DbDataAdapter.Fill(System.Data.DataTable[], Int32, Int32, System.Data.IDbCommand, System.Data.CommandBehavior) 
                at System.Data.Common.DbDataAdapter.Fill(System.Data.DataTable) 
                at FALCON_HR.DAL.DataAccessLayer.SelectData(System.String, System.Data.SqlClient.SqlParameter[]) 
                at FALCON_HR.BL.CLS_SHAPE.get_shape_state() 
                at FALCON_HR.FRM_LOGIN..ctor() at FALCON_HR.Program.Main()
            </Data> 
    </EventData>
</Event>

已解决:这一切都与连接有关,我给程序一个服务器名称,除了我的电脑以外不存在任何地方。

谢谢大家的关注&amp;你的答案。

0 个答案:

没有答案