Merge branch 'master' of http://github.com/mono/mono
[mono.git] / mcs / class / System.Data / System.Data.SqlTypes.jvm / SqlNullValueException.cs
index b52e50674337f83e9e5cee511507c169f8e9a7f6..75f9382508920e78925bdef172115fc30e22a912 100644 (file)
@@ -1,4 +1,4 @@
-// System.Data.SqlTypes.SqlNullValueException\r
+// System.Data.SqlTypes.SqlNullValueException
 //
 // Authors:
 //     Konstantin Triger <kostat@mainsoft.com>
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
+using System.Runtime.Serialization;
 
 namespace System.Data.SqlTypes
 {
-
-    /**
-     * The exception that is thrown for errors in an arithmetic, casting, or conversion operation
-     *
-     * @author  Pavel Sandler
-     * @version 1.0, 01/01/03
-     */
-
-    /*
-    * CURRENT LIMITATIONS
-    * 1. Constructor(SerializationInfo info, StreamingContext context) is not supported
-    * 2. Method "void GetObjectData(...,...)" is not supported from ISerializable
-    */
-
        [Serializable]
     public class SqlNullValueException : System.Data.SqlTypes.SqlTypeException
     {
-        /**
-                                            * Initializes a new instance of the <code>SqlNullValueException</code> class.
-                                            */
         public SqlNullValueException() : base("Data is Null. This method or property cannot be called on Null values.")
         {
         }
 
-        /**
-         * Initializes a new instance of the <code>SqlNullValueException</code> class
-         * with a specified error message.
-         *
-         * @param message The message that describes the error.
-         */
         public SqlNullValueException(String message): base(message)
         {
+                       _message = message;
+        }
+
+               public SqlNullValueException (SerializationInfo info, StreamingContext context) 
+                       : this () {
+                       _message = (string) info.GetString ("SqlNullValueExceptionMessage");
+               }
+
+               public SqlNullValueException(String message, Exception innerException): base(message, innerException)
+        {
+                       _message = message;
+        }
+
+               public override void GetObjectData (SerializationInfo si, StreamingContext context)
+        {                                             
+            si.AddValue ("SqlNullValueExceptionMessage", Message);                
         }
     }
 }
\ No newline at end of file