Esempio n. 1
0
 private static string getoperation(OperaitonType o, string fieldname)
 {
     if (o == OperaitonType.addfield)
     {
         return("adding column " + fieldname + " in");
     }
     else if (o == OperaitonType.addkey)
     {
         return("adding primary key " + fieldname + " in ");
     }
     else if (o == OperaitonType.alterfield)
     {
         return("altering column " + fieldname + " attributes in ");
     }
     else if (o == OperaitonType.dropfield)
     {
         return("droping column " + fieldname + " in ");
     }
     else if (o == OperaitonType.dropkey)
     {
         return("droping primary key in ");
     }
     else
     {
         return(" altering table in ");
     }
 }
Esempio n. 2
0
 public TableSchemaException(string tablename,
                             string fieldname,
                             OperaitonType operation,
                             string message,
                             System.Exception ex)
     : base(processMessage(tablename,
                           fieldname,
                           operation, message))
 {
 }
Esempio n. 3
0
 public TableSchemaException(string tablename,
                             string fieldname,
                             OperaitonType operation,
                             string message)
     : base(processMessage(tablename, fieldname, operation, null))
 {
     TableName = tablename;
     Operation = operation;
     FieldName = fieldname;
 }
Esempio n. 4
0
 private static string processMessage(string tablename,
                                      string fieldname,
                                      OperaitonType operation,
                                      string message)
 {
     if (message == null)
     {
         return("Error while " + getoperation(operation, fieldname) + " " + tablename);
     }
     else
     {
         return("Error while " + getoperation(operation, fieldname) + " " + tablename + ":" + message);
     }
 }
Esempio n. 5
0
 public TableSchemaException() : base()
 {
     TableName = "Unknown table name";
     Operation = OperaitonType.unknown;
 }