public ReportChangedAction() { try { this.con = new SqlCeConnection(); string dbConString = SampleSourceHelper.GetOfflineCubeLocation(); dbConString = dbConString.Remove(dbConString.LastIndexOf(@"\")) + @"\ReportsTable.sdf;Persist Security Info=False"; this.con.ConnectionString = "DataSource=" + dbConString; } catch (Exception e) { MessageBox.Show(e.Message, "Error in DB connection"); } }
/// <summary> /// Initializes a new instance of the <see cref="ReportSerializationViewModel"/> class. /// </summary> public ReportSerializationViewModel() { try { if (AppDomain.CurrentDomain.BaseDirectory.Contains("Binaries_")) { ConnectionString = ReportSerializationModel.Initialize(System.IO.Path.GetFullPath(@"..\..\common\Assets\Config\OLAPSample.config")); } else { ConnectionString = ReportSerializationModel.Initialize(System.IO.Path.GetFullPath(@"..\..\..\common\Assets\Config\OLAPSample.config")); } this.olapDataManager = new OlapDataManager(ReportSerializationViewModel.ConnectionString); this.con = new SqlCeConnection(); string dbConString = SampleSourceHelper.GetOfflineCubeLocation(); dbConString = dbConString.Remove(dbConString.LastIndexOf(@"\")) + @"\ReportsTable.sdf;Persist Security Info=False"; this.con.ConnectionString = "DataSource=" + dbConString; } catch (Exception e) { MessageBox.Show(e.Message, "Error in DB connection"); } }