fx\src\data\Microsoft\SqlServer\Server\SqlRecordBuffer.cs (69)
55private StorageType _type;
74Debug.Assert(StorageType.Boolean == _type, "Wrong storage type: " + _type);
80_type = StorageType.Boolean;
88Debug.Assert(StorageType.Byte == _type, "Wrong storage type: " + _type);
94_type = StorageType.Byte;
102Debug.Assert(StorageType.DateTime == _type, "Wrong storage type: " + _type);
108_type = StorageType.DateTime;
123Debug.Assert(StorageType.DateTimeOffset == _type, "Wrong storage type: " + _type);
129_type = StorageType.DateTimeOffset;
137Debug.Assert(StorageType.Double == _type, "Wrong storage type: " + _type);
143_type = StorageType.Double;
151Debug.Assert(StorageType.Guid == _type, "Wrong storage type: " + _type);
157_type = StorageType.Guid;
165Debug.Assert(StorageType.Int16 == _type, "Wrong storage type: " + _type);
171_type = StorageType.Int16;
179Debug.Assert(StorageType.Int32 == _type, "Wrong storage type: " + _type);
185_type = StorageType.Int32;
193Debug.Assert(StorageType.Int64 == _type, "Wrong storage type: " + _type);
199_type = StorageType.Int64;
212Debug.Assert(StorageType.Single == _type, "Wrong storage type: " + _type);
218_type = StorageType.Single;
227if (StorageType.String == _type) {
229} else if (StorageType.CharArray == _type) {
234Debug.Assert(StorageType.ByteArray == _type, "Wrong storage type: " + _type);
244_type = StorageType.String;
257Debug.Assert(StorageType.SqlDecimal == _type, "Wrong storage type: " + _type);
265_type = StorageType.SqlDecimal;
273Debug.Assert(StorageType.TimeSpan == _type, "Wrong storage type: " + _type);
279_type = StorageType.TimeSpan;
289if (StorageType.String == _type) {
293Debug.Assert(StorageType.ByteArray == _type, "Wrong storage type: " + _type);
302_type = StorageType.ByteArray;
306Debug.Assert(StorageType.ByteArray == _type, "Wrong storage type: " + _type);
317Debug.Assert(StorageType.CharArray == _type || StorageType.String == _type, "Wrong storage type: " + _type);
325_type = StorageType.CharArray;
329Debug.Assert(StorageType.CharArray == _type || StorageType.String == _type, "Wrong storage type: " + _type);
331((StorageType.CharArray == _type && value <= ((char[])_object).Length) || (StorageType.String == _type && value <= ((string)_object).Length)),
351case StorageType.Boolean: return SmiMetaData.DefaultBit;
352case StorageType.Byte: return SmiMetaData.DefaultTinyInt;
353case StorageType.ByteArray: return SmiMetaData.DefaultVarBinary;
354case StorageType.CharArray: return SmiMetaData.DefaultNVarChar;
355case StorageType.DateTime: return _metadata ?? SmiMetaData.DefaultDateTime;
356case StorageType.DateTimeOffset: return SmiMetaData.DefaultDateTimeOffset;
357case StorageType.Double: return SmiMetaData.DefaultFloat;
358case StorageType.Guid: return SmiMetaData.DefaultUniqueIdentifier;
359case StorageType.Int16: return SmiMetaData.DefaultSmallInt;
360case StorageType.Int32: return SmiMetaData.DefaultInt;
361case StorageType.Int64: return _metadata ?? SmiMetaData.DefaultBigInt;
362case StorageType.Single: return SmiMetaData.DefaultReal;
363case StorageType.String: return _metadata ?? SmiMetaData.DefaultNVarChar;
364case StorageType.SqlDecimal: return new SmiMetaData(SqlDbType.Decimal, 17, ((SqlDecimal)_object).Precision, ((SqlDecimal)_object).Scale, 0, SqlCompareOptions.None, null);
365case StorageType.TimeSpan: return SmiMetaData.DefaultTime;
383if (StorageType.String == _type) {
387Debug.Assert(StorageType.ByteArray == _type, "Wrong storage type: " + _type);
401Debug.Assert(StorageType.CharArray == _type || StorageType.String == _type, "Wrong storage type: " + _type);
405if (StorageType.CharArray == _type) {
417if (IsNull || StorageType.ByteArray != _type) {
422_type = StorageType.ByteArray;
450if (IsNull || (StorageType.CharArray != _type && StorageType.String != _type)) {
455_type = StorageType.CharArray;
462if (StorageType.String == _type) { // convert string to char[]
464_type = StorageType.CharArray;
489Debug.Assert(StorageType.String == _type, "ConvertXmlStringToByteArray: Invalid storage type for conversion: " + _type.ToString());
500_type = StorageType.ByteArray;