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
  1. Home
  2. Mobile Development
  3. Mobile
  4. big database on sqlCE - it Takes a long time to open connection

big database on sqlCE - it Takes a long time to open connection

Scheduled Pinned Locked Moved Mobile
helpcsharpdatabasequestion
2 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.
  • G Offline
    G Offline
    goldsoft
    wrote on last edited by
    #1

    hi i have database on sqlCE 75.6MB with 600,000 rows that has one table with 3 columns A - lenght 13 (text) B - lenght 20 (text) C - lenght 21 (text) i open the connection like this:

    bool OpenConn()
    {
    try
    {
    Conn = new SqlCeConnection(String.Format(@"Data Source={0}\
    {1}", PathI, "MyDB.SDF"));
    Conn.Open();
    return true;
    }
    catch (SqlCeException err)
    {
    MessageBox.Show(err.Message, "Connetion error");
    return false;
    }
    }

    the problem that it take a long time to open connection. is there any other way for open and work with big database ? i work on sqlCE for Windows-CE or Windows-Mobile in C# thanks in advance

    R 1 Reply Last reply
    0
    • G goldsoft

      hi i have database on sqlCE 75.6MB with 600,000 rows that has one table with 3 columns A - lenght 13 (text) B - lenght 20 (text) C - lenght 21 (text) i open the connection like this:

      bool OpenConn()
      {
      try
      {
      Conn = new SqlCeConnection(String.Format(@"Data Source={0}\
      {1}", PathI, "MyDB.SDF"));
      Conn.Open();
      return true;
      }
      catch (SqlCeException err)
      {
      MessageBox.Show(err.Message, "Connetion error");
      return false;
      }
      }

      the problem that it take a long time to open connection. is there any other way for open and work with big database ? i work on sqlCE for Windows-CE or Windows-Mobile in C# thanks in advance

      R Offline
      R Offline
      rwal901
      wrote on last edited by
      #2

      We've had no problem with opening connections to databases up to 250mb on devices. Our connection string looks like..... "Data Source = \Storage Card\our_db.sdf;Max Database Size = 500;Max Buffer Size=4096;File Mode=Shared Read;Persist Security Info=False;" Opening the connection shouldn't be slow, I'm not sure what the default max size is but try specifying size, buffer and mode to see if it helps.

      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