Click here to Skip to main content
15,885,771 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I develop a software in vb.net. I ran its EXE on a system and it runs successfully but when I am running the EXE on another system it through exception
'System.OutOfMemoryException' was thrown

both the systems are brand new and having same configuration

code where it crashes is :-
VB
Dim cmdDeleteData As New SqlCommand("delete from temp_grimage_offline", webCon)
        cmdDeleteData.ExecuteNonQuery()
 
        Dim bulk_BeeEnn As New SqlBulkCopy(webCon)
        bulk_BeeEnn.BulkCopyTimeout = 0
        bulk_BeeEnn.DestinationTableName = "temp_grimage_offline"
 
        bulk_BeeEnn.WriteToServer(ds.Tables(0))
 
        checkingForDataDuplicacy()
        Dim cmd_insert As New SqlCommand("insert into emp.dbo.grimage(grno,grimage,stn,scanneddate,tbb,topay,paid,[to],actualwt,chargedwt,nags,ftl,imageid,dgr,empid,grdate,nags_loose, " +
                                         "freight,hamali,l_c,st_ser,surcharge,vsc,stationary_ch,dd_chrgs,st_entry,total,upload_date) select grno,grimage,stn, " +
                                         "scanneddate,tbb,topay,paid,[to],actualwt,chargedwt,nags,ftl,imageid,dgr,empid, " +
                                         "grdate,nags_loose,freight,hamali,l_c,st_ser,surcharge,vsc,stationary_ch,dd_chrgs,st_entry,total,getdate() " +
                                         "from emp.dbo.temp_grimage_offline", webCon)
        cmd_insert.CommandTimeout = 0
 
        cmd_insert.ExecuteNonQuery()
 

        Dim cmd_update As New SqlCommand("update emp.dbo.grimage set flag = '1' where flag = '0' or flag is null", localCon)
        cmd_update.ExecuteNonQuery()
        cmd_update.CommandTimeout = 0
Posted
v2
Comments
Fredrik Bornander 4-Sep-13 3:31am    
Can you show us the stacktrace?
ledtech3 8-Sep-13 0:28am    
This might help.
Troubleshooting Exceptions: System.OutOfMemoryException
http://msdn.microsoft.com/en-us/library/9w766t6y(v=vs.90).aspx

1 solution

the following section is not explained:

checkingForDataDuplicacy()
 
Share this answer
 
Comments
Ron Beyer 5-Sep-13 20:47pm    
This is a comment, not a solution, please use the "Have a Question or Comment" for posting these types of things.
Tiaan Lombard (TiLO) 5-Sep-13 20:57pm    
Noted :)

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