Example #1
0
        public static void UpdateDataSet(this MSMO.Table table, Data.ApplicationDataSet.DBTablesRow tableRow)
        {
            try
            {
                tableRow.DataSpaceUsed = table.DataSpaceUsed;

                try
                {
                    tableRow.DateLastModified = table.DateLastModified;
                }
                catch (Exception ex)
                {
                    PLLog.Warning(ex, PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 1);
                }

                tableRow.Owner    = table.Owner;
                tableRow.RowCount = table.RowCount;
            }
            catch (Exception ex)
            {
                // TODO(crhodes):  Need to wrap anything above that throws an exception
                // that we want to ignore, e.g. property not available because of
                // SQL Edition.
                PLLog.Error(ex, PLLOG_APPNAME, CLASS_BASE_ERRORNUMBER + 2);
                throw ex;
            }
        }
Example #2
0
        //private static void UpdateDatabaseWithSnapShot(Data.ApplicationDataSet.DBTablesRow dataRow, string snapShotError)
        //{
        //    try
        //    {
        //        dataRow.SnapShotDate = DateTime.Now;
        //        dataRow.SnapShotError = snapShotError;
        //        Common.ApplicationDataSet.DBTablesTA.Update(Common.ApplicationDataSet.DBTables);
        //    }
        //    catch (Exception ex)
        //    {
        //        string errorMessage = string.Format("DBTablesRow.ID:{0} - ex:{1} ex.Inner:{2}", dataRow.ID, ex, ex.InnerException);
        //        VNC.AppLog.Error(errorMessage, LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 7);
        //    }
        //}

//        public static void UpdateDataSet(this MSMO.Table table, Data.ApplicationDataSet.DBTablesRow dataRow)
//        {

//            try
//            {
//                try
//                {
//                    dataRow.DataSpaceUsed = table.DataSpaceUsed;
//                }
//                catch (Exception ex)
//                {
//#if TRACE
//                    dataRow.DataSpaceUsed = -1;
//                    VNC.AppLog.Debug(ex.ToString(), LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 10);
//#endif
//                }

//                try
//                {
//                    dataRow.DateLastModified = table.DateLastModified;
//                }
//                catch (Exception ex)
//                {
//#if TRACE
//                    VNC.AppLog.Debug(ex.ToString(), LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 11);
//#endif
//                }

//                dataRow.FileGroup = table.FileGroup;
//                dataRow.Owner = table.Owner;
//                dataRow.RowCount = table.RowCount;
//            }
//            catch (Exception ex)
//            {
//                VNC.AppLog.Error(ex, LOG_APPNAME, CLASS_BASE_ERRORNUMBER + 12);
//                // TODO(crhodes):
//                // Wrap anything above that throws an exception that we want to ignore,
//                // e.g. property not available because of SQL Edition.

//            }
//        }

        private static void ReportException(Exception ex, Data.ApplicationDataSet.DBTablesRow dataRow, int eventID)
        {
            string errorMessage = "";

            if (dataRow != null)
            {
                errorMessage          = string.Format("DBTablesRow.ID:{0} - ex:{1} ex.Inner:{2}", dataRow.ID, ex, ex.InnerException);
                dataRow.SnapShotError = errorMessage;
                Common.ApplicationDataSet.DBTables_Update();
            }
            else
            {
                errorMessage = string.Format("DBTablesRow(null) - ex:{0} ex.Inner:{1}", ex, ex.InnerException);
            }

            VNC.AppLog.Error(errorMessage, LOG_APPNAME, eventID);
        }