Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7626999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:24:04+00:00 2026-05-31T05:24:04+00:00

Hey Guys I’m working on Windows Mobile 5.0 (.Net 2.0) and I’m stuck at

  • 0

Hey Guys I’m working on Windows Mobile 5.0 (.Net 2.0)
and I’m stuck at a small problem where my reader is always being null. My connection is fine and I believe everything else is fine the only problem is with the reader.
In my exception catch it says

((System.Data.SqlServerCe.SqlCeException)(e)) :  {"The operation completed successfully."}
InnerException: Could not evaluate expression

My database file is not corrupt I opened it outside the application and everything looks fine.
My code is as follows:

  public static List<Image> GetAll(BOI caller)
    {
        List<Image> images = new List<Image>();
        SqlCeConnection c = Connection.GetConnection(caller.ConnectionString);

        if (c != null)
        {
            SqlCeCommand command = new SqlCeCommand("SELECT * FROM Images", c);

            SqlCeDataReader reader = null;
            try
            {
                reader = command.ExecuteReader();  <<<<< reader is null <<<<<<<
            }
            catch (Exception e)
            {
                while (reader != null && reader.Read())
                {
                    Image temp = new Image((int)reader["imageKey"],
                              (String)reader["filename"],
                              (byte[])reader["image"],
                              (reader["labelKey"] == DBNull.Value ? null : (int?)reader["labelKey"]),
                              (int)reader["priority"]);
                    temp.SetDBName(caller.ConnectionString);

                    images.Add(temp);
                }
            }
        }

        return images;
    }

EDIT
I open my connection in Connection.GetConnection(..);

EDIT:2
The e.StackTrace:

   at System.Data.SqlServerCe.SqlCeDataReader.ProcessResults(Int32 hr)
   at System.Data.SqlServerCe.SqlCeDataReader.FillMetaData(SqlCeCommand command)
   at System.Data.SqlServerCe.SqlCeCommand.InitializeDataReader(SqlCeDataReader reader, Int32 resultType)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteReader()
   at Oralys.BOI.DataAccess.ImageMapper.GetAll(BOI caller)
   at Oralys.BOI.BOI.get_Images()
   at Oralys.BOI.BOI_Controller.FetchAllImages()
   at IdeoVoiceMobile.RunProfile.InitBOI()
   at IdeoVoiceMobile.RunProfile..ctor()
   at IdeoVoiceMobile.Program.startProfile()
   at IdeoVoiceMobile.Program.Main()

Get Connection function:

    public static SqlCeConnection GetConnection(string connectionString)
    {
        SqlCeConnection conn = null;
        try
        {
            if (connections.Count == 0)
            {
                OpenConnection(connectionString);
            }
            conn = connections[connectionString];
        }
        catch (System.Exception)
        {
        }
        return conn;
    }

EDIT:3
Exception code when using

SqlCeCommand command = new SqlCeCommand(“SELECT * FROM Images Where
imageKey=6”, c);

ExceptionCode: 0xc0000005
ExceptionAddress: 0x0115438c
Reading: 0x00000000
Faulting module: sqlceqp35.dll
Offset: 0x0001438c

   at NativeMethods.GetKeyInfo(IntPtr pIUnknown, IntPtr pTx, String pwszBaseTable, IntPtr prgDbKeyInfo, Int32 cDbKeyInfo, IntPtr pError)
   at SqlCeDataReader.FillMetaData(SqlCeCommand command)
   at SqlCeCommand.InitializeDataReader(SqlCeDataReader reader, Int32 resultType)
   at SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
   at SqlCeCommand.ExecuteReader(CommandBehavior behavior)
   at SqlCeCommand.ExecuteReader()
   at ImageMapper.GetAll(BOI caller)
   at BOI.get_Images()
   at BOI_Controller.FetchAllImages()
   at RunProfile.InitBOI()
   at RunProfile..ctor()
   at Program.startProfile()
   at Program.Main()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:24:05+00:00Added an answer on May 31, 2026 at 5:24 am

    The problem ended up to be because I was using System.Data.SqlServerCe 3.5.1.0 when I switched to 3.5.0.0 it worked without any error.
    And I put the while loop outside the catch statement.

    But I’m still annoyed from MS because they didnt show any error regarding that!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys (and gals) I'm having a problem using Assembly GetExportedTypes() in .NET 4.0.
hey guys having this really simple problem but cant seem to figure out have
Hey guys was hoping you could help me out. basically i'm working on a
hey guys was hoping you could help me out, Not sure if I always
Hey Guys i am currently trying to stopping one tableviewcell from being editable. But
Hey guys I'm having a big problem. I've been trying to set up my
Hey guys! I have this little problem: I have one ViewController which adds 2
Hey guys, I have a problem (again). This time I am trying to use
Hey guys, I am very new to AJAX and and working on a rating
Hey guys I'm currenlty working on something and I want if I click a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.