public void ExportCustomers() { SqlCompactConnection conn = new SqlCompactConnection(); try { Customer cus = new Customer(); CustomerCollection CusCol = new CustomerCollection(); string where = "customerid > 0 AND ActiveFlag=1"; string orderby = "customerid"; CusCol = cus.GetCustomersCollection(where, orderby); conn.DropCustomerTable(); conn.CreateCustomerTable(); conn.SynchForm = this; conn.AddCustomer(CusCol); } catch (Exception ex) { MessageBox.Show(ex.Message, "MICS", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { conn.CloseDatabase(); conn = null; } }