예제 #1
0
 internal int keyOfCorrectAnsver()
 {
     foreach (KeyValuePair <int, string> answer in optionalAnswers)
     {
         if (MSSQLConnector.IsCorrectAnswer(this.id, answer.Key))
         {
             return(answer.Key);
         }
     }
     throw new MissingFieldException("This question doesn't bind to any correct ansver.");
 }
예제 #2
0
 static void Main(string[] args)
 {
     try
     {
         MSSQLConnector.BuildConnection("string", "string", "string", "string");
         sqlState = building;
         Console.WriteLine("Connection was succesfully built.");
         sqlState = succeed;
     }
     catch (InvalidOperationException ex)
     {
         Console.WriteLine(ex.Message);
         sqlState = failed;
     }
     Console.ReadKey();
 }