Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. .NET raises Native exception in SQL Compact on WinCE

.NET raises Native exception in SQL Compact on WinCE

Scheduled Pinned Locked Moved Database
csharpdatabasec++helpquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hairy_hats
    wrote on last edited by
    #1

    Hi all, I'm running a .NET CF 2 application on WinCE, accessing a SQL Compact 3.5 database, and calling SqlCeDataAdapter.Fill() raises an error:

    ExceptionCode: 0xC0000005
    ExceptionAddress: 0x01a7438C
    Reading 0x00000000

    It seems to be caused by the underlying native DLLs but I cannot trap the error using C# exceptions. Any suggestions as to the likely cause/possible solution please? TIA! :beer:

    C 1 Reply Last reply
    0
    • H hairy_hats

      Hi all, I'm running a .NET CF 2 application on WinCE, accessing a SQL Compact 3.5 database, and calling SqlCeDataAdapter.Fill() raises an error:

      ExceptionCode: 0xC0000005
      ExceptionAddress: 0x01a7438C
      Reading 0x00000000

      It seems to be caused by the underlying native DLLs but I cannot trap the error using C# exceptions. Any suggestions as to the likely cause/possible solution please? TIA! :beer:

      C Offline
      C Offline
      Covean
      wrote on last edited by
      #2

      0xC0000005 means Access Violation while reading address 0x00000000 (null). Take a look at your code and try to find out if you set some null parameter or something else.

      Greetings Covean

      H 1 Reply Last reply
      0
      • C Covean

        0xC0000005 means Access Violation while reading address 0x00000000 (null). Take a look at your code and try to find out if you set some null parameter or something else.

        Greetings Covean

        H Offline
        H Offline
        hairy_hats
        wrote on last edited by
        #3

        I'm calling it from C# using allocated variables, and the database is being opened without error. Accessing it using totally different code also raises the same error.

        C 1 Reply Last reply
        0
        • H hairy_hats

          I'm calling it from C# using allocated variables, and the database is being opened without error. Accessing it using totally different code also raises the same error.

          C Offline
          C Offline
          Covean
          wrote on last edited by
          #4

          Without some code it will be hard to say where the error lies. Especially access violations are not that rare and can have a wide range of causes. It also can be a bug in the underlaying system (what I don't believe), but in most cases the programmer causes this problem.

          Greetings Covean

          H 1 Reply Last reply
          0
          • C Covean

            Without some code it will be hard to say where the error lies. Especially access violations are not that rare and can have a wide range of causes. It also can be a bug in the underlaying system (what I don't believe), but in most cases the programmer causes this problem.

            Greetings Covean

            H Offline
            H Offline
            hairy_hats
            wrote on last edited by
            #5

            Thanks for the reply, this is the code - it crashes on the last line. It also crashes when filling a DataTable.

            SqlCeConnection conn = new SqlCeConnection( connectionString );

            conn.Open();

            SqlCeCommand selectCmd = conn.CreateCommand();

            selectCmd.CommandText = @"Select Value From MyTable where ColumnOne=101";

            SqlCeDataAdapter adp = new SqlCeDataAdapter( selectCmd );

            System.Data.DataSet ds = new System.Data.DataSet();

            adp.Fill( ds );

            C 1 Reply Last reply
            0
            • H hairy_hats

              Thanks for the reply, this is the code - it crashes on the last line. It also crashes when filling a DataTable.

              SqlCeConnection conn = new SqlCeConnection( connectionString );

              conn.Open();

              SqlCeCommand selectCmd = conn.CreateCommand();

              selectCmd.CommandText = @"Select Value From MyTable where ColumnOne=101";

              SqlCeDataAdapter adp = new SqlCeDataAdapter( selectCmd );

              System.Data.DataSet ds = new System.Data.DataSet();

              adp.Fill( ds );

              C Offline
              C Offline
              Covean
              wrote on last edited by
              #6

              Your code looks good and should execute without problems. Is any stack trace of this error available? (The complete trace from adp.Fill(...) to the access violation would be nice)

              Greetings Covean

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups