當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。