0

my problem is i just finished a C# program using visual studio 2012 , sql server management studio 2014 , sap crystal report and .net framework 4.5.1

this is not my first program i finish using these programs by the way

then i created a setup file and copied it to another pc and tried to start it but the program don't start or even give me an error message so i tried on of my old programs on the same pc which i made in the same way it worked

so what should i do ?

by the way this pc i setup .net framework 4.5.1 on , sap crystal report runntime and the same sql server version

this is the error in the windows event log

- <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>

SOLVED: this all was about the connection, i gave the program a server name that was not exist any where but my computer .

Thank you all for your attention & your answers .

  • 3
    Is there anything in Window's Event Log (Applications)? –  Jan 18 '16 at 01:10
  • yes i found two errors .net runtime and application error too what shoud i copy for you exactly – Mahmoud Sami Jan 18 '16 at 01:28
  • You say you have SQL Server on the destination machine....do you have a database/users/tables, etc. setup? – Steve Wellens Jan 18 '16 at 01:55
  • It looks like the error is in connecting to your database. What sort of a connection string are you using? Is it working through a UDL file, or a named ODBC data source? If the connection source hasn't gone across to the new machine you won't be able to connect to the database. – Adrian Jan 18 '16 at 01:56
  • ok i'll try to check the connection to my DB – Mahmoud Sami Jan 18 '16 at 02:10
  • Write the check in code to give yourself better diagnostics. If your program is a Windows Service, [write it](http://stackoverflow.com/a/10838170/2226988) so you can also run it as a console app so you get your diagnostics in the console window. – Tom Blodget Jan 18 '16 at 03:08
  • it was a problem of db connection and i solved it thanks all for answers – Mahmoud Sami Feb 10 '16 at 01:34

0 Answers0