关闭它时,C#(。exe)应用程序崩溃。将显示错误弹出窗口

时间:2015-02-10 15:15:21

标签: c# sybase-ase

我有一个使用c#创建的应用程序。它访问Sybase数据库。应用程序本身就像一个冠军。然而,当我关闭它时,我收到此错误弹出窗口,表示我的应用程序已崩溃。这些是细节:

Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01:   myProgramName.exe
Problem Signature 02:   1.0.0.0
Problem Signature 03:   54d52bc7
Problem Signature 04:   Sybase.AdoNet4.AseClient
Problem Signature 05:   16.0.0.4
Problem Signature 06:   5400d1c0
Problem Signature 07:   ae
Problem Signature 08:   2d
Problem Signature 09:   System.NullReferenceException
OS Version: 6.1.7601.2.1.0.256.48
Locale ID:  1033
Additional Information 1:   0a9e
Additional Information 2:   0a9e372d3b4ad19135b953a78882e789
Additional Information 3:   0a9e
Additional Information 4:   0a9e372d3b4ad19135b953a78882e789

Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt

这是什么意思?我该如何解决这个问题?

访问Sybase时,我使用的是“using”语句:

using (AseConnection conn = new AseConnection(connectionString))
        {
            using (AseCommand cmd = new AseCommand(sql, conn))
            {
                try
                {
                    conn.Open();
                    using (AseDataReader reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            table.Add(new TableInformation
                            {
                                info1 = reader.GetInt16(0),
                                info2 = reader.GetString(1),
                                info3 = reader.GetString(2),
                                info4 = reader.GetString(3),
                                info5  = reader.GetString(4),
                                info6 = reader.GetString(5),
                                info7 = reader.GetString(6)
                            });
                        }
                    }
                }
                catch (AseException ex)
                {
                    blah blah blah
                }
            }
        }

我设法得到了异常消息。你们还在想什么呢?

System.NullReferenceException occurred
Message: A first chance exception of type 'System.NullReferenceException' occurred in Sybase.AdoNet4.AseClient.dll
Additional information: Object reference not set to an instance of an object.

0 个答案:

没有答案