未指定的错误 [英] Unspecified error

查看:97
本文介绍了未指定的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的先生,
我正在用C#开发Windows窗体应用程序.我有一个Microsoft Access 2007 .accdb文件.该数据库文件包含2个表.每个表中有145列.我正在与此文件等建立oledb连接,可以.我根据其他一些处理结果搜索来自TABLE1的数据.如果找到匹配项,则从TABLE1中读取该行,并且该列中没有空数据(检查是否这样做
如果(TABLE1.READER.IsDBNull(counter)== false)
对于这个ROW.如果满足此条件,则同时与TABLE2建立连接.而且它只有一个ROW,因此我直接从相同的列号(计数器)中选择数据.这一切我都在while循环中完成,然后将它们作为单个字符串进行连接(添加),然后将其写入普通的ASCII文件中以进行进一步处理.它能够读取两个表的第一行并将它们成功地写入ASCII文件,而没有任何错误,而在while循环中,它开始读取第二行,并且能够读取直到131(计数器)列和134(计数器),则无法与TABLE2建立连接并在异常捕获中给出未指定的错误".解决此问题的任何方法.

Respected Sir,
I am developing a windows form application in C#. I have one Microsoft Access 2007 .accdb file. This DB file contains 2 Tables. In each table there are 145 columns. I am making oledb connection to this file etc., Its OK. Data from TABLE1 I search, based on some other process results. If match is found I read this row from TABLE1 and the column which has no null data (Check for doing this
if (TABLE1.READER.IsDBNull(counter) == false)
for this ROW. If this condition is satisfied, at same moment I make connection with TABLE2. And it has only one ROW so I directly pick the data from the same column number (counter). This all I do in a while loop, then concat (add) them as a single string and I write it to a plain ASCII file for further processing. It is able to read the first row of both the table and write them successfully to a ASCII file without any error, in while loop it starts reading the second row and is able to read the data upto 131 (counter) column and for 134 (counter) it is unable to make connection with the TABLE2 and give "Unspecified ERROR" in exception Catch. Any solution to this problem.

推荐答案

也许该行在列132中具有空值...

Maybe the row has a null value in column 132...


您应该考虑重新设计表格. 145列恕我直言,对于列数而言太大.

您是否检查了内部异常或堆栈跟踪并选中了外部代码选项?可能会提供一些很好的信息.
You should consider redesigning the tables. 145 columns IMHO is too large for number of columns.

Did you checked the inner exception ot stack trace with external code option checked? It might give some good information to proceed with.


您是否将这些列的值强制转换为字符串以外的其他值?
您正在使用4.0,因此循环是否并行执行?
读完每一行需要多长时间?
您的查询和循环是什么样的?您可以张贴代码吗?
Are you casting the values of these columns to anything else besides string?
You''re using 4.0, so is your loop executing in parallel?
How long does it take to read through each row?
What does your query and loop look like? Could you possibly post code?


这篇关于未指定的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆