HighTechTalks DotNet Forums  

DBF Import Crashes .NET APP and no error log whatsoever

Dotnet Framework (ADO.net) microsoft.public.dotnet.framework.adonet


Discuss DBF Import Crashes .NET APP and no error log whatsoever in the Dotnet Framework (ADO.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Henok Girma
 
Posts: n/a

Default DBF Import Crashes .NET APP and no error log whatsoever - 12-22-2007 , 08:17 AM






Hello,
I have the following code to connect and query a dbf file.

string cnn = @"Driver={Microsoft dBASE Driver
(*.dbf)};DriverID=277;Dbq=C:\DBF;exclusive=yes";
OdbcConnection odbcCnn = new OdbcConnection(cnn);
odbcCnn.Open();
OdbcCommand odbcCmd = odbcCnn.CreateCommand();
odbcCmd.CommandText = @"SELECT * FROM C:\DBF\Users.DBF";
OdbcDataReader reader =odbcCmd.ExecuteReader();
..
..
..
but at this point, the .net application crashes. I have the code surrounded
by try{} catch{} and even then the whole app crashes, there is no error
generated, no message, just the application vanishes. I'm at loss as to how
to troubleshoot this.

the same code works fine on my dev machine, but on some machine, I believe 2
separate machines, I have experienced what I just described.

where can i look for logged errors. does the .net framework log when .net
apps crash? there is no log in the windows event logs.

any help is greatly appreciated.


Reply With Quote
  #2  
Old   
Henok Girma
 
Posts: n/a

Default Re: DBF Import Crashes .NET APP and no error log whatsoever - 12-24-2007 , 12:10 AM






anyone?

"Henok Girma" <replyoverhereonly (AT) here (DOT) com> wrote

Quote:
Hello,
I have the following code to connect and query a dbf file.

string cnn = @"Driver={Microsoft dBASE Driver
(*.dbf)};DriverID=277;Dbq=C:\DBF;exclusive=yes";
OdbcConnection odbcCnn = new OdbcConnection(cnn);
odbcCnn.Open();
OdbcCommand odbcCmd = odbcCnn.CreateCommand();
odbcCmd.CommandText = @"SELECT * FROM C:\DBF\Users.DBF";
OdbcDataReader reader =odbcCmd.ExecuteReader();
.
.
.
but at this point, the .net application crashes. I have the code
surrounded
by try{} catch{} and even then the whole app crashes, there is no error
generated, no message, just the application vanishes. I'm at loss as to
how
to troubleshoot this.

the same code works fine on my dev machine, but on some machine, I believe
2
separate machines, I have experienced what I just described.

where can i look for logged errors. does the .net framework log when .net
apps crash? there is no log in the windows event logs.

any help is greatly appreciated.



Reply With Quote
  #3  
Old   
Paul Clement
 
Posts: n/a

Default Re: DBF Import Crashes .NET APP and no error log whatsoever - 12-24-2007 , 12:23 PM



On Sat, 22 Dec 2007 08:17:25 -0500, "Henok Girma" <replyoverhereonly (AT) here (DOT) com> wrote:

¤ Hello,
¤ I have the following code to connect and query a dbf file.
¤
¤ string cnn = @"Driver={Microsoft dBASE Driver
¤ (*.dbf)};DriverID=277;Dbq=C:\DBF;exclusive=yes";
¤ OdbcConnection odbcCnn = new OdbcConnection(cnn);
¤ odbcCnn.Open();
¤ OdbcCommand odbcCmd = odbcCnn.CreateCommand();
¤ odbcCmd.CommandText = @"SELECT * FROM C:\DBF\Users.DBF";
¤ OdbcDataReader reader =odbcCmd.ExecuteReader();
¤ .
¤ .
¤ .
¤ but at this point, the .net application crashes. I have the code surrounded
¤ by try{} catch{} and even then the whole app crashes, there is no error
¤ generated, no message, just the application vanishes. I'm at loss as to how
¤ to troubleshoot this.
¤
¤ the same code works fine on my dev machine, but on some machine, I believe 2
¤ separate machines, I have experienced what I just described.
¤
¤ where can i look for logged errors. does the .net framework log when .net
¤ apps crash? there is no log in the windows event logs.
¤
¤ any help is greatly appreciated.

Have you tried using Jet OLEDB and the dBase ISAM driver instead of the ODBC driver?


Paul
~~~~
Microsoft MVP (Visual Basic)

Reply With Quote
  #4  
Old   
John Saunders [MVP]
 
Posts: n/a

Default Re: DBF Import Crashes .NET APP and no error log whatsoever - 12-24-2007 , 03:03 PM



"Henok Girma" <replyoverhereonly (AT) here (DOT) com> wrote

Quote:
Hello,
I have the following code to connect and query a dbf file.

string cnn = @"Driver={Microsoft dBASE Driver
(*.dbf)};DriverID=277;Dbq=C:\DBF;exclusive=yes";
OdbcConnection odbcCnn = new OdbcConnection(cnn);
odbcCnn.Open();
OdbcCommand odbcCmd = odbcCnn.CreateCommand();
odbcCmd.CommandText = @"SELECT * FROM C:\DBF\Users.DBF";
OdbcDataReader reader =odbcCmd.ExecuteReader();
.
.
.
but at this point, the .net application crashes. I have the code
surrounded
by try{} catch{} and even then the whole app crashes, there is no error
generated, no message, just the application vanishes. I'm at loss as to
how
to troubleshoot this.

the same code works fine on my dev machine, but on some machine, I believe
2
separate machines, I have experienced what I just described.

where can i look for logged errors. does the .net framework log when .net
apps crash? there is no log in the windows event logs.

any help is greatly appreciated.
Please try surrounding the code with the following:

try
{
// Your code here
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
catch
{
Console.WriteLine("Unmanaged exception thrown!");
}
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.