Going Mobile Listing #3: Database Upgrade

try
{
  conn.Open();
}
catch (SqlCeException ex)
{
  if (ex.NativeError == 25138)
  {
    SqlCeEngine sce = new SqlCeEngine(conn.ConnectionString);
    sce.Upgrade();
    conn.Open();
  }
}

comments powered by Disqus
Upcoming Events

.NET Insight

Sign up for our newsletter.

I agree to this site's Privacy Policy.