FilterName Field

Type.FilterName Field


Represents the case-sensitive member filter used on names. This field is read-only.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

public static readonly MemberFilter FilterName

This field holds a reference to the delegate used by the FindMembers method. The method encapsulated by this delegate takes two parameters: the first is a MemberInfo object and the second is an Object. The method determines whether the MemberInfo object matches the criteria specified by the Object. The Object is assigned a string value, which may include a trailing "*" wildcard character. Only wildcard end string matching is supported.

For example, the Object may be assigned the value "Byte*". In that case, when the FilterName delegate is invoked, it will return true only if the method represented by the MemberInfo object has a name that begins with "Byte".

The following code example gets the methods associated with the user-defined Application type.

private static void RetrieveIdentity(string connectionString)
    using (SqlConnection connection =
               new SqlConnection(connectionString))
        // Create a SqlDataAdapter based on a SELECT query.
        SqlDataAdapter adapter =
            new SqlDataAdapter(
            "SELECT CategoryID, CategoryName FROM dbo.Categories",

        //Create the SqlCommand to execute the stored procedure.
        adapter.InsertCommand = new SqlCommand("dbo.InsertCategory", 
        adapter.InsertCommand.CommandType = CommandType.StoredProcedure;

        // Add the parameter for the CategoryName. Specifying the
        // ParameterDirection for an input parameter is not required.
           new SqlParameter("@CategoryName", SqlDbType.NVarChar, 15,

        // Add the SqlParameter to retrieve the new identity value.
        // Specify the ParameterDirection as Output.
        SqlParameter parameter = 
            "@Identity", SqlDbType.Int, 0, "CategoryID");
        parameter.Direction = ParameterDirection.Output;

        // Create a DataTable and fill it.
        DataTable categories = new DataTable();

        // Add a new row. 
        DataRow newRow = categories.NewRow();
        newRow["CategoryName"] = "New Category";


        Console.WriteLine("List All Rows:");
        foreach (DataRow row in categories.Rows)
                Console.WriteLine("{0}: {1}", row[0], row[1]);

.NET Framework
Available since 1.1
Return to top
© 2015 Microsoft