Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Comments
E.F. Nijboer 11-Jan-11 7:36am    
I would suggest using a real database engine instead of (always corrupted) access.
Abhinav S 11-Jan-11 7:42am    
Did you try debugging your code?
Espen Harlinn 11-Jan-11 7:48am    
What was the number of columns again? concat as in CSV? If possible, you may consider a redesign ...
zaki_8279025 11-Jan-11 9:01am    
There are 145 column in each table.
Sergey Alexandrovich Kryukov 11-Jan-11 10:29am    
E.F. Nijboer, this is a good point -- about Access. I would not blame you if you posted this as an answer... Best advice -- not using Access. However such solutions are in high demand in "office plankton" (did you hear about this term?).

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

 
Share this answer
 
v2
Comments
zaki_8279025 11-Jan-11 8:56am    
iT IS NOT SO, IAM ALWAYS CHECKING THAT COLUMN HAS A DATA BY USING THIS EXPRESSION
if (TABLE1.IsDBNull(counter) == false)
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.
 
Share this answer
 
Comments
zaki_8279025 11-Jan-11 8:58am    
If it is so then how come first row it reads successfully, Just I would like to know that Connection Timeout may help in any way?
fjdiewornncalwe 11-Jan-11 10:11am    
@zaki: It is because you have way to many columns in the table that is making it very difficult for you to process the data now. I have spent many years developing huge, enterprise level systems and I have NEVER had a table with more than 30 or 40 columns and even those, in my opinion, were too large.
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?
 
Share this answer
 
Comments
zaki_8279025 11-Jan-11 12:25pm    
Thanx for your response
No I am not casting any values these are just string only.
Yes All loops are executing parallel and Ok.
It take few seconds only less than 60 Secs.
The following is the query
OleDbDataReader tbl2_oledbReader = Dlogic.Read_material("Select * from MATERIAL_LABELS");

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900