.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sandeep Singh
Post New Web Links

Native exception 0xc0000005 when using SQLCE 3.0/3.1 and .NET CF 2.0?!

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :Sql Server
Greetings, I have written a very basic C# console test app to check the performance and reliability of SQLCE on Windows CE 5.0 (source code below). Running this on different Windows CE 5.0 devices, I always get a 0xc0000005 native exception error when reaching 25592 inserts. It doesn't matter whether the database is empty or not when the test is run, it always fails at that exact number of inserts. Given that I would expect a managed application not to be able to generate native exceptions anyway, and can't really see any reason why it would in this case, I'm at a bit of a loss as to what's going wrong... Any ideas? Using: VS2005 w/ SP1 Windows CE 5.0 (on custom SH4 platform and HTC WM5 smartphone) .NET CF 2.0 w/ SP1 and post SP1 patch SQLCE 3.0.3600.0 TIA PS. The same code (with some SQLCE 3.0 specific bits removed - version and result set for checking table existence) works perfectly under .NET CF 1.0 and SQLCE 2.0). Source code: using System.Data; using System.Data.SqlServerCe; namespace TestDB {     class Program     {         static void Main(string[] args)         {             SqlCeConnection sqlConnection = new SqlCeConnection();             SqlCeCommand sqlCommand = sqlConnection.CreateCommand();             SqlCeResultSet sqlResult;             string strDatabase = "\\TestDB.sdf";             string strTable = "TestTable";        

View Complete Post

More Related Resource Links

Error: A native exception has occurred in my_file.exe

Hello everyone,   This error is occurring with me when I am working with SSCE in my pocket PC. Can anyone tell me why?   Thanks!

Native Exception in GetKeyInfo()

We developed a product on Win CE 5 using Visual Studio 2005. I am evaluating an upgrade to Visual Studio 2008 because we believe the SQL Server CE 3.5 database format is better supported.

We installed updates in platform builder to get SQL Server CE 3.5 and we rebuilt the platform. I have installed Visual Studio 2008 with SP1 for both .net and SQL Server CE.

I tried making an entirely new project with a fresh DB for testing, so that everything will agree and there won't be any strange faults lingering from settings in any old project. All the Properties sheets seems to indicate that my database is a 3.5 database. The project builds and deploys with no problems, but after the connection is open, any attempt to fill a table from the database results in this exception:

Exception Code: 0x80000002
Exception Address: 0x03194008
Faulting Module: sqlceme35.dll
at NativeMethods.GetKeyInfo( IntPtr pTx, String pwszBaseTable, IntPtr prgDbKeyInfo, Int32 cDbKeyInfo, IntPtr pError )
at SqlCeDataReader.FillMetaData( SqlCeCommand command )
at SqlCeCommand.InitializeDataReader( SqlCeDataReader reader, Int32 resultType )

The fault is happening in MS code that I cannot step into...anyone recognize this problem?

Weird Exception C015000F in 32bit MFC app on 64 bit windows 7 with SQLCE 3.5 SP2

Exception code: C015000F The activation context being deactivated is not the
most recently activated one.
Fault address: 776F4391 01:00074391 C:\Windows\SysWOW64\ntdll.dll
One of my customers is getting the following error apparently when trying to
update an SQLCE 3.5 SP2 database.
It appears that the correct 32 and 64 bit versions of Sp2 are installed on
his machine.
Unfortunately, on the 64 bit w7 machine I have, the error doesn't occur.
I've tracked this down to possibly being related to this hotfix:
described more fully here:
http://blog.paulbetts.org/index.php/2010/07/20/the-case-of-the-disappearing-onload-exception-user-mode-callback-exceptions-in-x64/Has anyone else run across this. Any obvious reasons SQLCE might throw anexception on one machine but not another? I have a copy of the databasethat was being accessed, but it appears fine.--Anthony WieserWieser Software Ltd

Anthony Wieser | Wieser Software Ltd | www.wieser-software.com

Failure sending mail: Exception 0xc0000005 was generated at address 0x000007FEE3D4122B Mail will not


I'm running SSRS 2008R2.  I'm getting the above error a a couple of email subscriptions.  Some email subscriptions work, a few I'm getting this error message.  I've seen the posts about resetting IIS, SSRS and Agent Service.  I've done this, and it does seem to temporary fix the issue, but then it comes back. 

The one post where it says the "From" field containing more than 255 characters.  This is not my situation.

I need to find a more permanent fix for this issue.  Does anybody have any further insight.  Some postings seem to be related to older versions of SSRS.  I'm on the latest.



Any help or suggestions would be appreciated.

ExceptionCode: 0xc0000005 using SQLCE when ExecuteReader() statement executes


I have this code:

string TmpMakat, TmpIsShakil, TmpDes;

        SqlCeDataReader read;

        public bool LOOK()

Native Exception at at SqlCeCommand.set_CommandText(String value)


I am having random native exception and all of those exceptions have this method common i.e  at SqlCeCommand.set_CommandText(String value). I am using .NETCE 3.5, SQLCE 3.5 SP2, i.e. System.Data.SqlServerCe.dll version 3.5.8080.0 and I also verified the version of Native dlls and it matches with managed dll.

Can anyone know why I am getting this native exception?

Here is the exception stack

ExceptionCode: 0x80000002

ExceptionAddress: 0x00e8c440

Faulting module: sqlceqp35.dll

Offset: 0x000bc440


   at NativeMethods.SafeRelease(IntPtr& ppUnknown)

Exception de première chance à 0x0aa11001 dans Appli.exe : 0xC0000005: Violation d'accès lors de la


I developpe one application in DotNet C++, I'm stuck in the following error :


Exception de première chance à 0x0aa11001 dans Appli.exe : 0xC0000005: Violation d'accès lors de la lecture de l'emplacement


My application communicates with a device in real time. For that, I use


Every self-respected programmer should include exception handling techniques. Sometimes your application will generate an error. Regardless of who was responsible for this error, the programmer or the user, it is up to the first to include the necessary exception handling techniques to keep his/her program from crashing. The .Net environment provides useful techniques for avoiding disastrous errors such as try-catch statements and user-defined exceptions.

Global Exception Handling with ASP.NET

After your global exception handler has done its work, you'll want to redirect the users of your website to a friendly page that tells them that something has gone wrong, and then provide them with customer support information as well as a link back to your web application's home page.

SQL Server 2005 Try and Catch Exception Handling

I'm pretty excited to see that there is some real error handling for T-SQL code in SQL Server 2005. It's pretty painful to have your wonderfully architected .NET solution tainted by less-than-VBScript error handling for stored procedures in the database. The big difference being the addition of TRY..CATCH blocks. Let's take a look:

reader.getordinal("column_may_not_exist") how to catch the exception?



would any body please help me to catch the exception if the column doesnot exist as my table columns are not static.

sometimes its throwing me indexoutofrange exception as the column doesnot exist

thanks for the help guys

Error while using exception handling block el 4.1


Hi Folks,


i am trying to use tyhe exception handling block of Enterprise library 4.1.


I just createda polisy and used IndexOutOfRangeException and added a replace handler and a logging handler to it.

I am using the NotifyRethrow PostHandlingAction to the exception.


During runtime I am getting an exception on the HandleException event, The exception is added below:



Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 42:             catch (Exception ex)
Line 43:             {
Line 44:                 bool reThrow = ExceptionPolicy.HandleException(ex, "ReplacePolicy");
Line 45:         

userprincipal.changepassword throws exception


Hi all,

      userprincipal.changepassword(oldpassword, newpassword);

gives error: that is Configuration information could not be read from the domain controller, either because the machine is unavailable, or access has been denied. (Exception from HRESULT: 0x80070547)

but userDirectoryEntry.invoke("ChangePassword", new object[] { oldpassword, newpassword });

      userDirectoryEntry.CommitChanges works fine.

Any one please tell me the reason behind this.

active directory exception unusual behaviour


i have a small problem
i want user names from active directory for an auto completer type of service
the method is always throwing an exception 
"searcher.FindAll()' threw an exception of type 'System.DirectoryServices.DirectoryServicesCOMException' System.DirectoryServices.SearchResultCollection 

"Exception from HRESULT: 0x800AC472"


Am Exporting Data in to Excel File,meanwhile if i open any other Excel file than the excel File on which am exporting data gets opened up Automatically having name Book1.How should i stop these excel file not to get open.In the Error log i get an error message showing " Exception from HRESULT: 0x800AC472" . Need help on these.Thanks in Advance.

WebControls.TableRow throws exception on Add()


I have the following method to strip hidden and user-specified columns from a gridviewrow and return a tablerow. 

    Private Shared Function StripHiddenColumns(ByVal gvRow As GridViewRow, ByVal ColumnsToExclude() As Integer) As TableRow

        Dim row As New TableRow
        Dim i As Integer = 0
            For Each cell As TableCell In gvRow.Cells
                If cell.Visible Then
                    If Not ColumnsToExclude.Contains(i) Then
                    End If
                End If
                i += 1

            Return row
        Catch ex As Exception
            Throw ex
        End Try
    End Function

However, when I run this code and hit the Add method for the TableRow,  I get an InvalidOperationException stating the Collection was modified; enumeration operation may not execute.  I've gotten this exception before, but usually it's because I'm attempting to modify a table that is databound.  This particular one is not, i am creating it.  Can anyone offer any insight? 

Thanks in advance.


CLR Inside Out: Best Practices For Managed And Native Code Interoperability


There are many factors to consider when building your app with both managed and native code. Find out how to employ interop and how to choose the interop that's right for you.

Jesse Kaplan

MSDN Magazine January 2009

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend