EmailAddressValidatorArrayToDataTable Method
Converts a string array into DataTable containing a single column named "email".

Namespace: MailBee.AddressCheck
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public DataTable ArrayToDataTable(
	string[] emails
)

Parameters

emails
Type: SystemString
The strings to be put into the resulting data table.

Return Value

Type: DataTable
The data table containing all the strings from the given array put under the "email" column.
Exceptions
ExceptionCondition
MailBeeInvalidArgumentExceptionemails is a null reference (Nothing in Visual Basic).
Remarks
This method is helpful if you need to pass a string array to BeginVerify(DataTable, IDataReader, String, AsyncCallback, Object) asynchronous method which accepts only DataTable as input. At the same time, normal version of Verify method already has Verify(String) overload which accepts string arrays directly.
Examples
The sample below is actually exerpt from MailBee.NET Objects source code which contains the essential parts of ArrayToDataTable(String) method. You can use it as a template to copy-paste and edit if you need to populate DataTable from other sources (like collections, lists or whatever).
public DataTable ArrayToDataTable(string[] emails)
{
    DataTable workTable = new DataTable();
    workTable.Columns.Add("email", typeof(string));
    foreach (string email in emails)
    {
        DataRow row = workTable.NewRow();
        row["email"] = email;
        workTable.Rows.Add(row);
    }
    return workTable;
}
See Also