dotConnect for MySQL Documentation
Devart.Data.MySql Namespace / MySqlBlob Class / Null Field
Example

In This Topic
    Null Field (MySqlBlob)
    In This Topic
    Represents a null MySqlBlob object.
    Syntax
    'Declaration
     
    Public Shadows Shared ReadOnly Null As MySqlBlob
    public new static readonly MySqlBlob Null
    Example
    In this sample a Null value is assigned to a MySqlBlob instance, then some properties are checked. If unchanged, this code produces the following output:

    It is empty.

    It is Null.

    public void MySqlBlobNullTest()
    {
      MySqlBlob myBlob = new MySqlBlob();
      myBlob = MySqlBlob.Null;
      if (myBlob.CanRead)
      {
        Console.WriteLine("It can read.");
      }
      if (myBlob.CanWrite)
      {
        Console.WriteLine("It can write.");
      }
      if (myBlob.CanSeek)
      {
        Console.WriteLine("It can seek.");
      }
      if (myBlob.IsEmpty)
      {
        Console.WriteLine("It is empty.");
      }
      if (myBlob.IsNull)
      {
        Console.WriteLine("It is Null.");
      }
    }
    Public Sub MySqlBlobNullTest()
      Dim myBlob As MySqlBlob = New MySqlBlob
      myBlob = MySqlBlob.Null
      If myBlob.CanRead Then
        Console.WriteLine("It can read.")
      End If
      If myBlob.CanWrite Then
        Console.WriteLine("It can write.")
      End If
      If (myBlob.CanSeek) Then
        Console.WriteLine("It can seek.")
      End If
      If myBlob.IsEmpty Then
        Console.WriteLine("It is empty.")
      End If
      If myBlob.IsNull Then
        Console.WriteLine("It is Null.")
      End If
    End Sub
    Remarks
    Use field Null to assign to a MySqlBlob in order to represent a Null value. In this case a BLOB inserted in a field of a table will be Null rather than zero-length byte array.
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also