System.Data.Common.DataStorage.IsObjectNull(object)

Here are the examples of the csharp api class System.Data.Common.DataStorage.IsObjectNull(object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

24 Examples 7

1. Example

Project: referencesource
Source File: DataExpression.cs
internal static bool IsUnknown(object value) {
            return DataStorage.IsObjectNull(value);
        }

2. Example

Project: referencesource
Source File: DataColumnPropertyDescriptor.cs
public override bool CanResetValue(object component) {
            DataRowView dataRowView = (DataRowView) component;
            if (!column.IsSqlType)
            	return (dataRowView.GetColumnValue(column) != DBNull.Value);
            return (!DataStorage.IsObjectNull(dataRowView.GetColumnValue(column)));
        }

3. Example

Project: referencesource
Source File: DataRelation.cs
private static bool IsKeyNull(object[] values) {
            for (int i = 0; i < values.Length; i++) {
                if (!DataStorage.IsObjectNull(values[i]))
                    return false;
            }

            return true;
        }

4. Example

Project: referencesource
Source File: ForeignKeyConstraint.cs
internal bool IsKeyNull( object[] values ) {
            for (int i = 0; i < values.Length; i++) {
            	if (! DataStorage.IsObjectNull(values[i]))
                    return false;
            }

            return true;
        }

5. Example

Project: referencesource
Source File: SQLBinaryStorage.cs
override public string ConvertObjectToXml(object value) {
            Debug.Assert(!DataStorage.IsObjectNull(value), "we should have null here");
            Debug.Assert((value.GetType() == typeof(SqlBinary)), "wrong input type");
            
            StringWriter strwriter = new StringWriter(FormatProvider);
            
            using (XmlTextWriter xmlTextWriter = new XmlTextWriter (strwriter)) {
                ((IXmlSerializable)value).WriteXml(xmlTextWriter);
            }
            return (strwriter.ToString ());
        }

6. Example

Project: referencesource
Source File: SQlBooleanStorage.cs
override public string ConvertObjectToXml(object value) {
            Debug.Assert(!DataStorage.IsObjectNull(value), "we should have null here");
            Debug.Assert((value.GetType() == typeof(SqlBoolean)), "wrong input type");

            StringWriter strwriter = new StringWriter(FormatProvider);

            using (XmlTextWriter xmlTextWriter = new XmlTextWriter (strwriter)) {
                ((IXmlSerializable)value).WriteXml(xmlTextWriter);
            }
            return (strwriter.ToString ());
        }

7. Example

Project: referencesource
Source File: SQLBytesStorage.cs
override public string ConvertObjectToXml(object value) {
            Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here");
            Debug.Assert((value.GetType() == typeof(SqlBytes)), "wrong input type");
            
            StringWriter strwriter = new StringWriter(FormatProvider);

            using (XmlTextWriter xmlTextWriter = new XmlTextWriter (strwriter)) {
                ((IXmlSerializable)value).WriteXml(xmlTextWriter);
            }
            return (strwriter.ToString ());
        }

8. Example

Project: referencesource
Source File: SQLByteStorage.cs
override public string ConvertObjectToXml(object value) {
            Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here");
            Debug.Assert((value.GetType() == typeof(SqlByte)), "wrong input type");

            StringWriter strwriter = new StringWriter(FormatProvider);

            using (XmlTextWriter xmlTextWriter = new XmlTextWriter (strwriter)) {
                ((IXmlSerializable)value).WriteXml(xmlTextWriter);
            }
            return (strwriter.ToString ());
        }

9. Example

Project: referencesource
Source File: SQLCharsStorage.cs
override public string ConvertObjectToXml(object value) {
            Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here");
            Debug.Assert((value.GetType() == typeof(SqlChars)), "wrong input type");
            
            StringWriter strwriter = new StringWriter(FormatProvider);

            using (XmlTextWriter xmlTextWriter = new XmlTextWriter (strwriter)) {
                ((IXmlSerializable)value).WriteXml(xmlTextWriter);
            }
            return (strwriter.ToString ());
        }

10. Example

Project: referencesource
Source File: SQLDateTimeStorage.cs
override public string ConvertObjectToXml(object value) {
            Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here");
            Debug.Assert((value.GetType() == typeof(SqlDateTime)), "wrong input type");

            StringWriter strwriter = new StringWriter(FormatProvider);

            using (XmlTextWriter xmlTextWriter = new XmlTextWriter (strwriter)) {
                ((IXmlSerializable)value).WriteXml(xmlTextWriter);
            }
            return (strwriter.ToString ());
        }

11. Example

Project: referencesource
Source File: SQLDecimalStorage.cs
override public string ConvertObjectToXml(object value) {
            Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here");
            Debug.Assert((value.GetType() == typeof(SqlDecimal)), "wrong input type");
            
            StringWriter strwriter = new StringWriter(FormatProvider);

            using (XmlTextWriter xmlTextWriter = new XmlTextWriter (strwriter)) {
                ((IXmlSerializable)value).WriteXml(xmlTextWriter);
            }
            return (strwriter.ToString ());
        }

12. Example

Project: referencesource
Source File: SQLDoubleStorage.cs
override public string ConvertObjectToXml(object value) {
            Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here");
            Debug.Assert((value.GetType() == typeof(SqlDouble)), "wrong input type");

            StringWriter strwriter = new StringWriter(FormatProvider);

            using (XmlTextWriter xmlTextWriter = new XmlTextWriter (strwriter)) {
                ((IXmlSerializable)value).WriteXml(xmlTextWriter);
            }
            return (strwriter.ToString ());
        }

13. Example

Project: referencesource
Source File: SQLGuidStorage.cs
override public string ConvertObjectToXml(object value) {
            Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here");
            Debug.Assert((value.GetType() == typeof(SqlGuid)), "wrong input type");
            
            StringWriter strwriter = new StringWriter(FormatProvider);

            using (XmlTextWriter xmlTextWriter = new XmlTextWriter (strwriter)) {
                ((IXmlSerializable)value).WriteXml(xmlTextWriter);
            }
            return (strwriter.ToString ());
        }

14. Example

Project: referencesource
Source File: SQLInt16Storage.cs
override public string ConvertObjectToXml(object value) {
            Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here");
            Debug.Assert((value.GetType() == typeof(SqlInt16)), "wrong input type");
            
            StringWriter strwriter = new StringWriter(FormatProvider);

            using (XmlTextWriter xmlTextWriter = new XmlTextWriter (strwriter)) {
                ((IXmlSerializable)value).WriteXml(xmlTextWriter);
            }
            return (strwriter.ToString ());
        }

15. Example

Project: referencesource
Source File: SQLInt32Storage.cs
override public string ConvertObjectToXml(object value) {
            Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here");
            Debug.Assert((value.GetType() == typeof(SqlInt32)), "wrong input type");
            
            StringWriter strwriter = new StringWriter(FormatProvider);

            using (XmlTextWriter xmlTextWriter = new XmlTextWriter (strwriter)) {
                ((IXmlSerializable)value).WriteXml(xmlTextWriter);
            }
            return (strwriter.ToString());
        }

16. Example

Project: referencesource
Source File: SQLInt64Storage.cs
override public string ConvertObjectToXml(object value) {
            Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here");
            Debug.Assert((value.GetType() == typeof(SqlInt64)), "wrong input type");
            
            StringWriter strwriter = new StringWriter(FormatProvider);

            using (XmlTextWriter xmlTextWriter = new XmlTextWriter (strwriter)) {
                ((IXmlSerializable)value).WriteXml(xmlTextWriter);
            }
            return (strwriter.ToString ());
        }

17. Example

Project: referencesource
Source File: SQLMoneyStorage.cs
override public string ConvertObjectToXml(object value) {
            Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here");
            Debug.Assert((value.GetType() == typeof(SqlMoney)), "wrong input type");
            
            StringWriter strwriter = new StringWriter(FormatProvider);

            using (XmlTextWriter xmlTextWriter = new XmlTextWriter (strwriter)) {
                ((IXmlSerializable)value).WriteXml(xmlTextWriter);
            }
            return (strwriter.ToString ());
        }

18. Example

Project: referencesource
Source File: SQLSingleStorage.cs
override public string ConvertObjectToXml(object value) {
            Debug.Assert(!DataStorage.IsObjectNull(value), "we should have null here");
            Debug.Assert((value.GetType() == typeof(SqlSingle)), "wrong input type");

            StringWriter strwriter = new StringWriter(FormatProvider);

            using (XmlTextWriter xmlTextWriter = new XmlTextWriter (strwriter)) {
                ((IXmlSerializable)value).WriteXml(xmlTextWriter);
            }
            return (strwriter.ToString ());
        }

19. Example

Project: referencesource
Source File: SQLStringStorage.cs
override public string ConvertObjectToXml(object value) {
            Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here");
            Debug.Assert((value.GetType() == typeof(SqlString)), "wrong input type");

            StringWriter strwriter = new StringWriter(FormatProvider); // consider passing cultureinfo with CultureInfo.InvariantCulture

            using (XmlTextWriter xmlTextWriter = new XmlTextWriter (strwriter)) {
                ((IXmlSerializable)value).WriteXml(xmlTextWriter);
            }
            return (strwriter.ToString ());
        }

20. Example

Project: referencesource
Source File: DataColumn.cs
internal bool IsMaxLengthViolated() {
            if (MaxLength < 0)
                return true;

            bool error = false;
            object value;
            string errorText = null;

            foreach (DataRow dr in Table.Rows) {
                if (dr.HasVersion(DataRowVersion.Current)) {
                    value = dr[this];
                    if (!this.isSqlType) {
                        if (value != null && value != DBNull.Value && ((string)value).Length > MaxLength) {
                            if (errorText == null) {
                                errorText = ExceptionBuilder.MaxLengthViolationText(this.ColumnName);
                            }
                            dr.RowError = errorText;
                            dr.SetColumnError(this, errorText);
                            error = true;
                        }
                    }
                    else {
                        if (!DataStorage.IsObjectNull(value) && ((SqlString)value).Value.Length > MaxLength) {
                            if (errorText == null) {
                                errorText = ExceptionBuilder.MaxLengthViolationText(this.ColumnName);
                            }
                            dr.RowError = errorText;
                            dr.SetColumnError(this, errorText);
                            error = true;
                        }
                    }
                }
            }
            return error;
        }

21. Example

Project: referencesource
Source File: DataColumn.cs
internal string GetColumnValueAsString(DataRow row, DataRowVersion version) {

            object objValue = this[row.GetRecordFromVersion(version)];

            if (DataStorage.IsObjectNull(objValue)) {
                return null;
            }

            string value = ConvertObjectToXml(objValue);
            Debug.Assert(value != null);

            return value;
        }

22. Example

Project: referencesource
Source File: DataColumn.cs
internal protected void CheckNotAllowNull() {
            if (_storage == null)
                return;

            if (sortIndex != null) {
                if (sortIndex.IsKeyInIndex(_storage.NullValue)) {// here we do use strong typed NULL for Sql types
                    throw ExceptionBuilder.NullKeyValues(ColumnName);
                }
            }
            else { // since we do not have index, we so sequential search
                foreach (DataRow dr in this.table.Rows) {
                    if (dr.RowState == DataRowState.Deleted)
                        continue;
                    if (!implementsINullable) {
                        if (dr[this] == DBNull.Value) {
                            throw ExceptionBuilder.NullKeyValues(ColumnName);
                        }
                    }
                    else {
                        if (DataStorage.IsObjectNull(dr[this])) {
                            throw ExceptionBuilder.NullKeyValues(ColumnName);
                        }
                    }
                }
            }
        }

23. Example

Project: referencesource
Source File: FunctionNode.cs
private object EvalFunction(FunctionId id, object[] argumentValues, DataRow row, DataRowVersion vers/n ..... /n //View Source file for more details /n }

24. Example

Project: referencesource
Source File: BinaryNode.cs
private object EvalBinaryOp(int op, ExpressionNode left, ExpressionNode right, DataRow row, DataRowV/n ..... /n //View Source file for more details /n }