当前位置: 首页>>代码示例>>C#>>正文


C# SqliteDataReader.IsDBNull方法代码示例

本文整理汇总了C#中Mono.Data.Sqlite.SqliteDataReader.IsDBNull方法的典型用法代码示例。如果您正苦于以下问题:C# SqliteDataReader.IsDBNull方法的具体用法?C# SqliteDataReader.IsDBNull怎么用?C# SqliteDataReader.IsDBNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mono.Data.Sqlite.SqliteDataReader的用法示例。


在下文中一共展示了SqliteDataReader.IsDBNull方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DecodePrivateKey

        AsymmetricKeyParameter DecodePrivateKey(SqliteDataReader reader, int column, ref byte[] buffer)
        {
            if (reader.IsDBNull (column))
                return null;

            int nread = ReadBinaryBlob (reader, column, ref buffer);

            return DecryptAsymmetricKeyParameter (buffer, nread);
        }
开发者ID:vdaron,项目名称:MimeKit,代码行数:9,代码来源:X509CertificateDatabase.cs

示例2: GetUserFromReader

		/// <summary>
		/// A helper function that takes the current row from the SqliteDataReader
		/// and hydrates a MembershipUser from the values. Called by the 
		/// MembershipUser.GetUser implementation.
		/// </summary>
		/// <param name="reader">SqliteDataReader object</param>
		/// <returns>MembershipUser object</returns>
		MembershipUser GetUserFromReader(SqliteDataReader reader)
		{
			object providerUserKey = reader.GetValue(0);
			string username = reader.GetString(1);
			string email = string.Empty;
			if (!reader.IsDBNull(2))
				email = reader.GetString(2);

			string passwordQuestion = string.Empty;
			if (!reader.IsDBNull(3))
				passwordQuestion = reader.GetString(3);
			
			string comment = string.Empty;
			if (!reader.IsDBNull(4))
				comment = reader.GetString(4);

			bool isApproved = reader.GetBoolean(5);
			bool isLockedOut = reader.GetBoolean(6);
			DateTime creationDate = reader.GetDateTime(7);

			DateTime lastLoginDate = new DateTime();
			if (!reader.IsDBNull(8))
				lastLoginDate = reader.GetDateTime(8);

			DateTime lastActivityDate = reader.GetDateTime(9);
			DateTime lastPasswordChangedDate = reader.GetDateTime(10);

			DateTime lastLockedOutDate = new DateTime();
			if (!reader.IsDBNull(11))
				lastLockedOutDate = reader.GetDateTime(11);

			MembershipUser u = new MembershipUser(this.Name,
												  username,
												  providerUserKey,
												  email,
												  passwordQuestion,
												  comment,
												  isApproved,
												  isLockedOut,
												  creationDate,
												  lastLoginDate,
												  lastActivityDate,
												  lastPasswordChangedDate,
												  lastLockedOutDate);
			
			return u;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:54,代码来源:SqliteMembershipProvider.cs

示例3: DecodeEncryptionAlgorithms

        static EncryptionAlgorithm[] DecodeEncryptionAlgorithms(SqliteDataReader reader, int column)
        {
            if (reader.IsDBNull (column))
                return null;

            var algorithms = new List<EncryptionAlgorithm> ();
            var values = reader.GetString (column);

            foreach (var token in values.Split (new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)) {
                EncryptionAlgorithm algorithm;

                if (Enum.TryParse (token.Trim (), out algorithm))
                    algorithms.Add (algorithm);
            }

            return algorithms.ToArray ();
        }
开发者ID:vdaron,项目名称:MimeKit,代码行数:17,代码来源:X509CertificateDatabase.cs

示例4: DataReturn

    /// <summary>
    /// 返回一個資料串
    /// </summary>
    public string DataReturn(SqliteDataReader data)
    {
        string database = "";

        for (int i = 0; i < data.FieldCount; i++) {

            // 資料是否為空
            switch (data.IsDBNull(i)) {
                case true:
                    switch (data.GetDataTypeName(i)){
                        case "TEXT":
                            database += "" + ",";
                            break;

                        case "INTEGER":
                            database += "" + 0 + ",";
                            break;

                        case "REAL":
                            database += "" + 0 + ",";
                            break;

                        default:
                            Debug.LogError("類型缺失");
                            return database;
                    }
                    break;
                case false:
                    switch (data.GetDataTypeName(i)) {
                        case "TEXT":
                            database += data.GetString(i) + ",";
                            break;

                        case "INTEGER":
                            database += "" + data.GetInt32(i) + ",";
                            break;

                        case "REAL":
                            database += "" + data.GetFloat(i) + ",";
                            break;

                        default:
                            Debug.LogError("類型缺失");
                            return database;
                    }
                    break;
            }
        }

        return database;
    }
开发者ID:apperdog,项目名称:Dungeon,代码行数:54,代码来源:DbAccess.cs

示例5: RecordFromReader

 private static Record RecordFromReader(SqliteDataReader reader)
 {
     return new Record(
         reader.GetString(RecordColumns.KEY_IDX),
         reader.IsDBNull(RecordColumns.VALUE_IDX) ? null : reader.GetString(RecordColumns.VALUE_IDX),
         reader.GetInt32(RecordColumns.SYNC_COUNT_IDX),
         new DateTime(long.Parse(reader.GetString(RecordColumns.LAST_MODIFIED_TIMESTAMP_IDX), CultureInfo.InvariantCulture.NumberFormat), DateTimeKind.Utc),
         reader.IsDBNull(RecordColumns.LAST_MODIFIED_BY_IDX) ? string.Empty : reader.GetString(RecordColumns.LAST_MODIFIED_BY_IDX),
         new DateTime(long.Parse(reader.GetString(RecordColumns.DEVICE_LAST_MODIFIED_TIMESTAMP_IDX), CultureInfo.InvariantCulture.NumberFormat), DateTimeKind.Utc),
         reader.GetInt32(RecordColumns.MODIFIED_IDX) == 1);
 }
开发者ID:aws,项目名称:aws-sdk-net,代码行数:11,代码来源:SQLiteLocalStorage.unity.cs

示例6: DatasetMetadataFromReader

 private static DatasetMetadata DatasetMetadataFromReader(SqliteDataReader reader)
 {
     return new DatasetMetadata(
         reader.GetString(DatasetColumns.DATASET_NAME_IDX) ?? string.Empty,
         new DateTime(long.Parse(reader.GetString(DatasetColumns.CREATION_TIMESTAMP_IDX), CultureInfo.InvariantCulture.NumberFormat), DateTimeKind.Utc),
         new DateTime(long.Parse(reader.GetString(DatasetColumns.LAST_MODIFIED_TIMESTAMP_IDX), CultureInfo.InvariantCulture.NumberFormat), DateTimeKind.Utc),
         reader.IsDBNull(DatasetColumns.LAST_MODIFIED_BY_IDX) ? string.Empty : reader.GetString(DatasetColumns.LAST_MODIFIED_BY_IDX),
         reader.GetInt32(DatasetColumns.STORAGE_SIZE_BYTES_IDX),
         reader.GetInt32(DatasetColumns.RECORD_COUNT_IDX));
 }
开发者ID:aws,项目名称:aws-sdk-net,代码行数:10,代码来源:SQLiteLocalStorage.unity.cs

示例7: GetSafeString

 public string GetSafeString(SqliteDataReader reader, int index)
 {
     if (reader.IsDBNull(index))
         return string.Empty;
     else
         return reader.GetString(index);
 }
开发者ID:DomiStyle,项目名称:DaRT,代码行数:7,代码来源:GUImain.cs


注:本文中的Mono.Data.Sqlite.SqliteDataReader.IsDBNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。