locked
SqlCeConnection.Open() takes very long time RRS feed

  • Question

  • SqlCeConnection.Open() takes very long time if the sdf file is more than 300MB, actually, SqlCeConnection.Open()  will not response in Windows Mobile 6.5 device, but it works in Windows 7.

    string connectionString = @"Data Source=\Navigator\tnmsdb_DISTRICT-00001-00008-00017.sdf;Max Database Size = 280";


    • Edited by Dong Yao Thursday, May 19, 2011 2:53 AM
    Wednesday, May 18, 2011 8:25 AM

Answers

  • I think you are hitting the issue described here . In brief when you try to open a database from desktop on a device for the first time sqlce will recreate all the indexes and takes lot of time. But from second connection onwards you should not see any delay.  
    Thanks, Tarun Ramsinghani Please mark this post as answers if it helps. “This post is provided "AS IS" with no warranties, and confers no rights”.
    • Marked as answer by Dong Yao Friday, May 20, 2011 2:38 AM
    Wednesday, May 18, 2011 12:05 PM

All replies

  • I think you are hitting the issue described here . In brief when you try to open a database from desktop on a device for the first time sqlce will recreate all the indexes and takes lot of time. But from second connection onwards you should not see any delay.  
    Thanks, Tarun Ramsinghani Please mark this post as answers if it helps. “This post is provided "AS IS" with no warranties, and confers no rights”.
    • Marked as answer by Dong Yao Friday, May 20, 2011 2:38 AM
    Wednesday, May 18, 2011 12:05 PM
  • Dear Tarun Ramsinghani, is there a way that don't change OS to solve the problem?
    Thursday, May 19, 2011 2:52 AM
  • Create the database on a Windows XP/Server 2003 desktop if moved to Windows Mobile 5/6.x
    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    Thursday, May 19, 2011 6:30 AM
  • We recently encountered the re-indexing problem when moving an SQLCE SDF database from Windows Server to Windows CE.  It was taking 7 minutes to re-index 60k barcode records in a varchar(30) index.  As it only affects string based indexes we improved this to 7 seconds by changing it from a primary key to an index enforcing uniqueness on the same column.
    Friday, March 4, 2016 11:40 AM